As an example, my prompt looks like the following:
cerebus:1: /usr/src/linux
; _
Cerebus is my hostname (my prompt is the same on my school's computer,
'cept it says jarthur there instead), 1 is the window number (I use
iScreen on the school's computer, so I have window numbers on both
machines), and the directory is the current working directory.
That part of the prompt is all handled by the prompt() function, which
is executed before the prompt is displayed each time. The hostname
and window number and hostname are figured out on login, and I have
cd/pwd functions to keep the current working directory updated without
running /bin/pwd all the time.
; is then the 'standard' prompt for my shell.
For those that haven't guessed, I'm not using some bloated bohemoth
like bash, tcsh, or even zsh - I'm using rc, an implementation of the
Plan 9 shell.
This goes beyond what you're asking, but I thought others might be
interested to see the sort of thing people might put into their prompt.
Oh, I should also add that the info line of my prompt is in red when
I've su'ed to root, to remind me of the dangers. :)
--
+ Jim Winstead Jr. (CSci '95)
| Harvey Mudd College
+ This is all my words. Honest!
set prompt="[%l]%n#"
which gives:
[tty2]kxb>
--
Karl Buck
Grain Marketing ---===PEROT FOR PRESIDENT===---
(913)776-2745
Something like (untested):Quote:> Does anyone know of a way for a login shell to determine which virtual
> console it's running in, so you could put it in your prompt,
> for instance?
tty=`tty`
tty=${tty##tty}
and put $tty in your prompt.
--
BURNS,JIM (returned student)
Georgia Institute of Technology, 30178 Georgia Tech Station,
uucp: ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt0178a
[...]
As if the '#' isn't enough. :-)Quote:>Oh, I should also add that the info line of my prompt is in red when
>I've su'ed to root, to remind me of the dangers. :)
Once you get used to the red, though, you'll clearly have to get it to
blink! :-)
--Quote:> + Jim Winstead Jr. (CSci '95)
1. creating a new virtual console alongside existing vt100 consoles
Hello,
For my own amusement I am interested in creating a special
console that will use the F12 key. Does anyone know
if it is possible to have the existing Linux consoles
coexisting with the new one? Or would I have to modify the
existing VT100 console? What I want to do is radically
different from a VT100 emulation.
Thanks.
3. is a virtual console truly virtual?
5. Second virtual console missing in SuSE-installation
7. unblank syslog virtual console
9. more virtual consoles !! :)
10. changing to another virtual console...
12. XDM and Virtual Consoles...
13. Virtual consoles on solaris 7?