SliTaz SliTaz Forum

You are not logged in.

#1 2021-05-26 19:41:05

gibor
Moderator
Registered: 2011-04-30
Posts: 1,067

Xterm Colored prompt issue

ciao, non riesco ad ottenere la shell colorata come root se accedo con un su (busybox).

Esempio: loggato come utente tux

xterm

tux@slitaz:~$ << giusta # Green and blue for users

su

Password:

root@slitaz:/home/tux$ >> sbagliata ancora # Green and blue for users

exit

login root

Password:

root@slitaz:~$ >> giusta # Red and blue for root

sono presenti /etc/bashrc and /etc/profile

per puro caso riuscii durante le prove a far funzionare la shell correttamente, ma ora non riesco più a risalire a quali impostazioni sono necessarie per ottenerla.

Chi mi sa dire come si ottiene?

----------------------------------------------------------------------------------------------------------------------

Xterm Colored prompt issue

hello, i can't get the colored shell as root if i login with a su (busybox).

Example: logged in as user tux

xterm

tux@slitaz:~$ << right # Green and blue for users

su

Password:

root@slitaz:/home/tux$ >> wrong again # Green and blue for users

exit

login root

Password:

root@slitaz:~$ >> right # Red and blue for root

there are /etc/bashrc and /etc/profile

by pure chance I managed to get the shell to work correctly, but now I can't find out what settings are needed to get it.

Who can tell me how to get it?

Offline

#2 2021-05-28 06:21:32

gibor
Moderator
Registered: 2011-04-30
Posts: 1,067

Re: Xterm Colored prompt issue

this solution is an horrible workaround, but work!

add at end of file ~.profile this alias

alias su='export PS1="\[\e[1;31m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\$ " && su && export PS1="\[\e[1;32m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\$ "'

Offline

#3 2021-05-28 08:26:11

bellard
Administrator
Registered: 2011-03-28
Posts: 657

Re: Xterm Colored prompt issue

You can try 'su -' or 'su -l' instead of 'su'.

According to 'su --help' this 'Clear environment, go to home dir, run shell as login shell'.

So /etc/profile is executed.

Offline

#4 2021-05-28 09:32:30

gibor
Moderator
Registered: 2011-04-30
Posts: 1,067

Re: Xterm Colored prompt issue

sì lo sapevo, ma il problema come anche Tu hai fatto notare, è che cambia posizione la shell (da pwd a home).

Non so come avevo fatto durante le prove passate che funzionava correttamente senza tanti problemi.

Pure qualche versione provvisoria di slitaz mi sembra che lo facesse, anche se non ti so dire quale fu esattamente.

-------------------------------------------------------------------------

Yes I knew that, but the problem as you also pointed out, is that the shell changes position (from pwd to home).

I don't know how I did it during the past tests that worked correctly without many problems.

Even some temporary version of slitaz seems to do it, but I can't tell you which one it was exactly.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.016 seconds, 7 queries executed - Memory usage: 1.53 MiB (Peak: 1.77 MiB) ]