[Top][All Lists]

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

Re: TTY, PWD, and other useful strings in hardstatus, shelltitle, etc

From: Eric D. Hendrickson
Subject: Re: TTY, PWD, and other useful strings in hardstatus, shelltitle, etc
Date: Tue, 01 Mar 2005 13:51:29 -0600
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

What I do, is I use tcsh and have the following line in my .cshrc

    if ($?TERM && ($TERM == "xterm" || $TERM == "screen" || $TERM == "rxvt")) 
      alias cwdcmd 'echo -n "]2;"/address@hidden"$cwd]1;"{$HOST}""'

Note that those control characters go like this:


in case they don't make it through the email...  cwdcmd is a command
that tcsh runs each time you change directories.

You should be able to work the tty in there too, since tcsh stores the
tty as "$tty".

This produces a titlebar (this works in PuTTY too) like (e.g.) this:


Hope this helps.

(screen user since late 80's!)

Peter Beckman <address@hidden> writes:

> I know it has been discussed many-a-time before (I've read the July 2004
> thread in the archives), but I wanted to bring it up again to see if there
> was any more movement within the development on it.
> Jason White made a patch to 4.0.2 that creates %T asan escape code that
> will echo the TTY.  Nice.  I'd love nothing more than to patch my code
> on all of my servers!
> So, I've spend the last 2 hours (instead of patching screen) trying to
> figure out a way to set up the windowlist or window title to show the TTY
> and/or the current working directory for that screen window.
> I thought about writing the tty to a file and have a backtick command read
> it, but then how to determine which file goes with which screen, and
> furthermore how to determine if it is a single or multiple files!  Too bad
> I couldn't do something like this:
>      backtick 1 5 5 cat ~/.screen/win.$WINDOW.pwd
>      backtick 2 5 5 cat ~/.screen/win.$WINDOW.tty
> because I could write those files every time a new window was created...
> I know I can use the escape codes in my prompt and put $TTY in there, but
> then my prompt doesn't auto-update the command being run.
> Any ideas that aren't as much as a hack?
> Beckman
> ---------------------------------------------------------------------------
> Peter Beckman                                                  Internet Guy
> address@hidden                   
> ---------------------------------------------------------------------------
> _______________________________________________
> screen-users mailing list
> address@hidden

reply via email to

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