Would you like to react to this message? Create an account in a few clicks or log in to continue.

  • Post new topic
  • Reply to topic

SOLVED: Very basic prompt in Konsole

avatar
davecs


Posts : 120
Join date : 2024-05-14

SOLVED: Very basic prompt in Konsole  Empty SOLVED: Very basic prompt in Konsole

Post by davecs 13th June 2024, 4:44 pm

This is a strange one, because I've tried changing ~/bashrc and ~/.profile but to no avail. All I can get is a basic "$" prompt for a user shell, but if I switch to root, it works properly:

Code:

$ su
Password:
[root@davecomp davepcd]# exit
exit
$
$ su      
Password:
[root@davecomp davepcd]# cd Desktop
[root@davecomp Desktop]# exit
exit
$
$ cd Desktop
$
$

The other thing is that the arrow buttons don't work properly as a user, producing a tilde followed by two left square brackets and A, B, C or D in user mode, but as soon as I su to root, they work correctly! I've also had a look at /root/.bashrc, /etc/profile and /etc/profile.d/ and I can't work out why I can't get the prompt to work. I've tried using PS1='something' within the shell, but everything just appears literally, rather than providing a prompt format. Again, it works correctly in root mode:

Code:
$
$ ^[[A^[[A^[[B^[[B^[[D^[[D^[[C^[[C
/bin/sh: 10: : not found
$
$ PS1="${debian_chroot:+($debian_chroot)}\[\033[01;31m\][\u@\h \[\e[0;1;34m\]\W\[\033[01;31m\]]#\[\e[0;0m\] "
\[\033[01;31m\][\u@\h \[\e[0;1;34m\]\W\[\033[01;31m\]]#\[\e[0;0m\]
\[\033[01;31m\][\u@\h \[\e[0;1;34m\]\W\[\033[01;31m\]]#\[\e[0;0m\]
\[\033[01;31m\][\u@\h \[\e[0;1;34m\]\W\[\033[01;31m\]]#\[\e[0;0m\] export PS1="${debian_chroot:+($debian_chroot)}\[\033[01;31m\][\u@\h \[\e[0;1;34m\]\W\[\033[01;31m\]]#\[\e[0;0m\] "
\[\033[01;31m\][\u@\h \[\e[0;1;34m\]\W\[\033[01;31m\]]#\[\e[0;0m\]
\[\033[01;31m\][\u@\h \[\e[0;1;34m\]\W\[\033[01;31m\]]#\[\e[0;0m\]
\[\033[01;31m\][\u@\h \[\e[0;1;34m\]\W\[\033[01;31m\]]#\[\e[0;0m\] su
Password:
[root@davecomp Desktop]# PS1="${debian_chroot:+($debian_chroot)}\[\033[01;31m\][\u@\h \[\e[0;1;34m\]\W\[\033[01;31m\]]#\[\e[0;0m\] "
[root@davecomp Desktop]#
[root@davecomp Desktop]#
[root@davecomp Desktop]# PS1="\[\033[01;31m\][\u@\h \[\e[0;1;34m\]\W\[\033[01;31m\]]#\[\e[0;0m\] "[root@davecomp Desktop]#
[root@davecomp Desktop]# exit
exit
\[\033[01;31m\][\u@\h \[\e[0;1;34m\]\W\[\033[01;31m\]]#\[\e[0;0m\] PS1="\[\033[01;31m\][\u@\h \[\e[0;1;34m\]\W\[\033[01;31m\]]#\[\e[0;0m\] "
\[\033[01;31m\][\u@\h \[\e[0;1;34m\]\W\[\033[01;31m\]]#\[\e[0;0m\]
\[\033[01;31m\][\u@\h \[\e[0;1;34m\]\W\[\033[01;31m\]]#\[\e[0;0m\] PS1="$"
$
————————————————————————————————
Any ideas?

P.S. I should have added: This works correctly on the Cinnamon desktop. On the KDE desktop, this affects Konsole, Yakuake and Xterm.


Last edited by davecs on 14th June 2024, 4:05 pm; edited 2 times in total
avatar
davecs


Posts : 120
Join date : 2024-05-14

SOLVED: Very basic prompt in Konsole  Empty Re: SOLVED: Very basic prompt in Konsole

Post by davecs 13th June 2024, 5:25 pm

I think I've found the reply here: https://askubuntu.com/questions/325807/arrow-keys-home-end-tab-complete-keys-not-working-in-shell

How do I change settings so that /bin/bash is used in the shell in future, instead of /bin/sh ?

avatar
davecs


Posts : 120
Join date : 2024-05-14

SOLVED: Very basic prompt in Konsole  Empty Re: SOLVED: Very basic prompt in Konsole

Post by davecs 13th June 2024, 5:36 pm

davecs wrote:I think I've found the reply here: https://askubuntu.com/questions/325807/arrow-keys-home-end-tab-complete-keys-not-working-in-shell

How do I change settings so that /bin/bash is used in the shell in future, instead of /bin/sh ?


Answered my own question! The answer is here: https://www.geeksforgeeks.org/how-to-change-default-shell-in-linux/

I think that some setup file needs to be changed so that users are allocated /bin/bash as their shell and not /bin/sh
avatar
davecs


Posts : 120
Join date : 2024-05-14

SOLVED: Very basic prompt in Konsole  Empty Re: SOLVED: Very basic prompt in Konsole

Post by davecs 14th June 2024, 6:01 am

Having done some reading, I think I know why this happened. I have a large hard drive with multiple root partitions, and have to set user IDs manually in order to be able to transfer data between different installations. So I am forced to use useradd or adduser then tidy up the records in the control center. I might try to write a script to ensure that everything is done properly first time.

Meanwhile, it might be better if the line SHELL=/bin/sh in /etc/default/useradd is changed to SHELL=/bin/bash.

Sponsored content


SOLVED: Very basic prompt in Konsole  Empty Re: SOLVED: Very basic prompt in Konsole

Post by Sponsored content

  • Post new topic
  • Reply to topic

Current date/time is 22nd November 2024, 2:55 am