You are not logged in.

#1 2021-03-11 16:05:24

othersamo_
Member
From: Braislava
Registered: 2020-10-26
Posts: 161

[SOLVED] different shell in tty

Hello,
I am a zsh user and since I use zsh, I added a theme to it - p10k. The problem is, however, that in tty(2-6) instead of icons, only pure white squares are displayed which is quite understandable since tty does not have that good graphical capabilities.

That's why I was thinking about changing shell only for tty(2-6). Is it possible and does anyone know how to deal with it, thank you!

My ~/.zshrc:
https://pastebin.com/kaaer82y

Last edited by othersamo_ (2021-03-13 17:41:54)


"Why join the navy if you can be a pirate?"
- Steve Jobs

Offline

#2 2021-03-11 16:38:25

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,552

Re: [SOLVED] different shell in tty

The typical approch would be to check ther terminal type/capacities (or parenting process because I actually don't want a powerline in mc either…) before setting your prompt…

read pcomm < /proc/$PPID/comm
if [ "$pcomm" = "mc" ]; then
…
elif [ "$pcomm" = "login" ]; then
…
else
…
fi

Offline

#3 2021-03-11 17:13:02

Maniaxx
Member
Registered: 2014-05-14
Posts: 761

Re: [SOLVED] different shell in tty

'tty' can be used as well to conditionally spawn 'exec bash'. Or log in as another user and define shell in /etc/passwd.

Last edited by Maniaxx (2021-03-11 17:13:58)


sys2064

Offline

#4 2021-03-13 17:41:33

othersamo_
Member
From: Braislava
Registered: 2020-10-26
Posts: 161

Re: [SOLVED] different shell in tty

seth wrote:

The typical approch would be to check ther terminal type/capacities (or parenting process because I actually don't want a powerline in mc either…) before setting your prompt…

read pcomm < /proc/$PPID/comm
if [ "$pcomm" = "mc" ]; then
…
elif [ "$pcomm" = "login" ]; then
…
else
…
fi

Thank you, I managed to solve it using this skeleton!


"Why join the navy if you can be a pirate?"
- Steve Jobs

Offline

Board footer

Powered by FluxBB