LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   LQ Poll: What is your favorite Linux Prompt? (https://www.linuxquestions.org/questions/linux-general-1/lq-poll-what-is-your-favorite-linux-prompt-4175692199/)

jeremy 03-17-2021 02:01 PM

LQ Poll: What is your favorite Linux Prompt?
 
The official LQ poll series continues. This time we want to know: What is your favorite Linux Prompt?

--jeremy

jamison20000e 03-17-2021 07:30 PM

Whatever pops up when I bash in:
Code:

echo $PS1
usually:
Code:

\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
that's a whole lot hu? :D
Code:

screenfetch
        _,met$$$$$gg.          chup@cabra
      ,g$$$$$$$$$$$$$$$P.        OS: Debian unstable sid
    ,g$$P""      """Y$$.".      Kernel: x86_64 Linux 5.10.0-4-amd64
  ,$$P'              `$$$.      Uptime: 24m
  ',$$P      ,ggs.    `$$b:    Packages: 1333
  `d$$'    ,$P"'  .    $$$    Shell: bash 5.1.4
  $$P      d$'    ,    $$P    Resolution: 1366x768
  $$:      $$.  -    ,d$$'    DE: Xfce
  $$\;      Y$b._  _,d$P'      WM: Xfwm4
  Y$$.    `.`"Y$$$$P"'          WM Theme: Default
  `$$b      "-.__              GTK Theme: Xfce [GTK2]
    `Y$$                        Icon Theme: Tango
    `Y$$.                      Font: Sans 10
      `$$b.                    Disk: 106G / 134G (80%)
        `Y$$b.                  CPU: Intel Core i5-2520M @ 2x 2.492GHz
            `"Y$b._              GPU: VMware SVGA II Adapter
                `""""            RAM: 842MiB / 4027MiB

Any GPL works tho. :hattip:

frankbell 03-17-2021 07:32 PM

What exactly do you mean by prompt? For example

Code:

$
or

Code:

username@computername $
Code:

path/to/directory $
or something entirely other.

(My choice of the three above would be the last one.)

fatmac 03-18-2021 04:46 AM

Just an indicator so that I can type the next command.... ;)

pan64 03-18-2021 05:10 AM

I use a lot of different computers, so I don't really care about it. I use what was configured (by default).
Code:

user@host:path$
is in general good enough (nowadays colored)

igadoter 03-18-2021 05:21 AM

For me prompt means value of PS1, so guys just post this
Code:

$ echo $PS1
I never did this myself but think PS1 should different depending on working on /dev/pts/x or /dev/tty. On virtual terminal one use something more nice or in contrary very simply like % I use now. While on tty only % is far too cryptic.

Edit: PS1 is primary prompt. Myself never touched default PS2 and so on, but maybe someone has for some reasons customized also non-primary prompts. If I would be really interesting in reasons.

hazel 03-18-2021 05:43 AM

All I need is my login name and current working directory plus $ or #. I also like an all-red prompt when I'm root.

GazL 03-18-2021 05:53 AM

heh. Jeremy is obviously running out of ideas for polls. ;)

For the most part I just use '\$ ' as a shell prompt. Never been one for all the bling.

hazel 03-18-2021 06:11 AM

You do need current working directory. It's not just bling. When I was setting up my new Slackware-15, I chrooted across and just happened to be working in the /etc/rc.d directory when I forgot where I was and accidentally deleted all my startup scripts. Not a disaster at that stage, but certainly a nuisance. That was because I had not set up a proper root prompt on the new system and the default prompt just said bash# without any indication of where you were. Believe me, I corrected that before I went any further.

GazL 03-18-2021 06:45 AM

Some folks will certainly find that useful. I really dislike it when you're getting deep in the filesystem hierarchy and your prompt is taking up over half the screen width. So, I prefer to just type pwd whenever I get lost, or if I just want to confirm I'm where I think I am. Yep, I'm probably just weird, but it works for me. ;)

teckk 03-18-2021 07:05 AM

Quote:

Myself never touched default PS2 and so on, but maybe someone has for some reasons customized also non-primary prompts. If I would be really interesting in reasons.
I do it in bash scripts sometimes, so it only lasts for the script, never in ~/.bashrc
Code:

#!/usr/bin/bash

col=$(tput setaf 2)
clr=$(tput sgr0)

options="q a b c"

PS3=""$col"Select an option.:  "$clr""

select opt in $options; do
    case $opt in
        q) clear; exit ;;
        a) echo "a" ;;
        b) echo "b" ;;
        c) echo "c" ;;
    esac
done

Code:

echo $PS1
[\u@\h \W]\$


hish2021 03-18-2021 07:55 AM

Quote:

Originally Posted by GazL (Post 6231598)
... I really dislike it when you're getting deep in the filesystem hierarchy and your prompt is taking up over half the screen width. ...

I use PROMPT_DIRTRIM in Bash. So my .bashrc has
Code:

PROMPT_DIRTRIM=3

Keith Hedger 03-18-2021 08:35 AM

never knew about PROMPT_DIRTRIM very handy thx, I learnt somthing new, don't you just love linux!

Keith Hedger 03-18-2021 08:41 AM

login name host and folder green for normal user red for root

igadoter 03-18-2021 08:52 AM

Is there someone with 2-line or more prompt? I was hesitating about terminal and shell which allow to provide such cool looking prompts. 2-line prompt can be convienient to work with long paths. Say username, hostname, date/time, working directory are on top line while bottom line is for input.


All times are GMT -5. The time now is 07:53 AM.