[Top][All Lists]

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

Re: shelltitle, window titling

From: Dan Mahoney, System Admin
Subject: Re: shelltitle, window titling
Date: Mon, 29 Aug 2005 04:32:34 -0400 (EDT)

On Thu, 25 Aug 2005, Phil!Gregory wrote:

* Dan Mahoney, System Admin <address@hidden> [2005-08-25 13:25 -0400]:
Is there any way to have command options included for certain commands?

i.e. to have some sort of script or regex look allow me to have
ssh:address@hidden, or

screen does not support this; its automatic titling stuff is relatively
simple.  Since you're running tcsh, you could use the postcmd alias to
achieve what you want.  (postcmd is tcsh's analog to zsh's preexec.)

I see form my notes that the tcsh invocation to get the name of the
current command into the shelltitle is

 alias postcmd 'echo -ne "^[k\!#:0^[\\"'

so this should do roughly what you want:

 alias postcmd 'echo -ne "^[k\!#:0 \!#:$^[\\"'

Okay, perchance I didn't get this through, my last email was written on about three active brain cells.

I can't for the life of me get the precmd/postcmd variables to understand the bracketed escape sequence, nor \033 or anything like that. The PROMPT command seems to have its own special sequence of %{ %} that you can wrap an escape sequence in. The echo builtin to tcsh SUPPOSEDLY understands escape sequences, but I don't believe it. I've tried instead calling /bin/echo, but clearly the -e is something unique to the gnuish stuff.

I don't use an editor that supports dumping nonprintable characters into the .tcshrc (I use nano).

with this in mind, I've switched over to the precmd and postcmd using "printf" to generate the necessary ascii escape sequences, instead.

        alias precmd 'printf "\033%s%s\033\\" "k" "tcsh"'
        alias postcmd 'printf "\033%s%s %s\033\\" "k" "\!#:0" "\!#:$"'

And this works decently.



"What's with the server farm down in the basement?"

-Spider, Three Skulls Commons at Selden House, 4/15/00

--------Dan Mahoney--------
Techie,  Sysadmin,  WebGeek
Gushi on efnet/undernet IRC
ICQ: 13735144   AIM: LarpGM

reply via email to

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