Score:1

Terminal not displaying directory, commands executing instantly when pasted; arrow up ==> ^[[A

al flag

I'm using Ubuntu 22.04.1 LTS. I created the user "dom" when I first set up Ubuntu. From then, I created another user, named "schule" that also had sudo rights. Here is how I created the account:

sudo useradd -m schule 
sudo su
usermod -aG sudo schule

The terminal on schule is extremely weird:

  • it doesn't show the directory you're in
  • it doesn't show username@computername
  • when you paste commands they instantly execute (except sudo commands)
  • if you try to use ARROW_UP to get your last command back, it instead puts ^[[A in the console.
  • if you try to use ARROW_DOWN to go down in your command history, it instead puts ^[[B in the console
  • it is just a blank $ and then nothing afterwards

Tried some stuff, including resetting the .bashrc file, or copying the contents of dom's bashrc into schule's bashrc but nothing worked. Here is how it looks when you try to type a command, and then use arrow up: enter image description here

I even tried creating another user, named "test" but the terminal also acts weird on there. The terminal is completely fine on dom. Does anybody know how to fix this?

noisefloor avatar
ec flag
What do you exactly mean by "clone the Dom" account? Did you use the system tools or did you manually copy files? And how did you create the Dom account, which is as per your post a root account? Ubuntu has no root account by default. Did you tweak the system to get a true root account? If so: how?
Rishon JR avatar
pl flag
try `sudo apt purge gnome-terminal` and then `sudo apt install gnome-terminal` to reset the gnome-terminal.
User1986 avatar
al flag
@noisefloor I overhauled the question, it should be much clearer now
Score:0
ir flag

The default shell given to a new user is sh not bash which is the default shell on Ubuntu ... I would delete the user and recreate using

sudo deluser --remove-home  schule  #  delete user

sudo useradd -m  -s /bin/bash  schule  #  create user and give bash

New user will have a file ~/.bashrc .... to give a nice terminal prompt which shows the current dir add following to the bottom of the user's ~/.bashrc file

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\] \$ '
Raffa avatar
jp flag
Please warn the OP and future readers of permanent data loss in the deleted user's home directory.
Score:0
zw flag

useradd is only for basic usage, so I'd suggest you are using adduser instead.

First delete your new user (the one you tested) with

deluser --remove-home schule 

Notice: Use this command with care. Deleting your main user (dom) is not a good idea.

Then try to create a user with its own home directory:

adduser -m -G sudo,adm,cdrom,video,lpadmin,dip,plugdev,sambashare schule

(you might not have all those groups, but those above I usually need to have a fullblown admin account)

log out and into the "schule" account.

Raffa avatar
jp flag
Please warn the OP and future readers of permanent data loss in the deleted user's home directory.
User1986 avatar
al flag
It's pretty clear that the data gets lost if the command is literally named "DELETE USER"
Raffa avatar
jp flag
@User1986 Not necessarily if the option `--remove-home` isn’t passed … Alternatively the option `--backup` can be added to automatically backup data before deletion … It’s a fact that some readers focus on solving the problem in the question and copy/paste commands to later discover their valuable data disappeared forever … This site is accessible to beginner Ubuntu users as well hence the need for a fair warning :-)
noisefloor avatar
ec flag
As the OP seems to be German-speaking (at least that's what I'm guessing from some of the sames), you may also want to read [https://wiki.ubuntuusers.de/adduser/](https://wiki.ubuntuusers.de/adduser/). The 2nd paragraph has some additional info on `adduser` vs. `useradd` ob Ubuntu.
kanehekili avatar
zw flag
@Raffa He was supposed to delete the faulty user "schule", not his main user. Still good advice, updated my answer
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.