Dan Mahoney, System Admin ([EMAIL PROTECTED]) said:
> On Thu, 25 Aug 2005, Aaron Griffin wrote:
> >I know someone who did something like this is zsh - I've been meaning
> >to ask him, but I know his screen displays "vim:/file/I/am/editing"
> >... maybe some version of ps? I guess it could be done if there's a
> >command called *right before* a command is executed... other than
> >that, besides aliasing each command, I don't know how...
>
> Well, looking at ps, it's pretty easy to figure out what the last argument
> is to a given command (nine times out of ten, that's going to be all that
> matters -- ssh -1 -l danm hostname, nano -w filename...) I just don't
> know how to pass that to screen, or how screen even "gets" the command by
> that sequence of escapes in the shell.
>
> And is this "zsh" person on the list?
I'm not the zsh person he's talking about... but here's my zsh stuff.
In zsh you can define a preexec() function to be executed just prior to
command execution. See zshmisc(1) for info.
I use:
titlestring='[EMAIL PROTECTED]:%~'
preexec() {
print -Pn "\E]0;$titlestring ${(QVz)2}\007"
}
I also have a precmd() that'll set the title back to a normal prompt
after the command.
--
Adam Lazur, Cluster Monkey
_______________________________________________
screen-users mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/screen-users