[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shelltitle, window titling

From: Adam Lazur
Subject: Re: shelltitle, window titling
Date: Thu, 25 Aug 2005 16:35:44 -0400
User-agent: Mutt/1.5.9i

Dan Mahoney, System Admin (address@hidden) 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:

    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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]