Weblog entry #1 for lindenle
1. First get the bash prexec utility.
2. Then I added the following to my .bashrc
if [ -f ${HOME}/bin/preexec.bash ] && [ "$TERM" == "screen" ] ; then
. ${HOME}/bin/preexec.bash
function set_screen_title () {
local title="$1"
echo -ne '\ek'${1}'\e\\'
}
function precmd () {
set_screen_title "$1"
}
function preexec () {
set_screen_title "$1"
}
preexec_install
fi
Now when I run screen it lists the full command of what I am running
as the screen name. Sweet!
Comments on this Entry
i use the screen name, that appears at the bottom, to know which screen i'm at.
in your case, how does setting the screen name to the executed command really help you? what does it do for you?
[ Parent | Reply to this comment ]
I often have many connections to many machines and using this utility I can see the machine and the command I am running. Here is an example where I am logged into my mail server watching some logs and also to remote host. Here is what the screen list looks like:
Num Name Flags
0 {@spike lindenle}: uprecords -f $
1 {@spike lindenle}: htop $
2 {@spike lindenle}: mutt $
3 {@one lindenle}: top $
4 {@spike lindenle}: sudo tail -f /var/log/mail.log $
5 {@spike lindenle}: $
6 {@localhost lindenle}: $
The other major advantage is not closing your session when you log out. For me this is a must because i do all my analysis on a remote computer cluster with only terminal access. In fact it has been a life saver a few times recently when working from hotels with flaky wireless connections, even when the network goes down and ssh connection hangs I can just log back in and reconnect to my screen session(s).
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
Your entries would look better if you stopped using " " tags everywhere and just used <pre> like everybody else.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
I'm afraid not. Comments are deliberately non-editble. If you like I can fix that one for you, but in general only articles, weblogs and polls are editable.
[ Parent | Reply to this comment ]
Thanks
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
You should be able to use "[pre]" + "[/pre]" to surround text. That will give it the same styling as the <pre> in HTML.
[ Parent | Reply to this comment ]
what is this 'bash prexec' anyway? I am unable to find any information about it on the web.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]