[Top][All Lists]

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

setting the window title for remote shell

From: Ross Boylan
Subject: setting the window title for remote shell
Date: Fri, 11 Apr 2014 17:00:33 -0700
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

I often ssh through a series of systems, run screen on the last system, start emacs in the screen window and then start up a bash shell. I would like it if the system window title reflected the system, and possibly the directory, I am in.

Various sources suggest
   echo -ne '\e]0;Title\a'
or building it in to the command prompt.

When I tried executing the command from a shell running under emacs it had no effect. I suspect emacs eats the non-printing characters. If I start another window under screen, running bash directly, executing the echo command does change the window title. The first step of the chain was running a cygwin bash shell (mintty) under Windows 7 (though other times I start from Linux using Konsole). The remote systems were all Debian GNU/Linux.

How can I get this to work?

I'm not entirely sure what the best behavior would be. To make it most like the non-emacs shell it would display the host and current directory, meaning it would have to change when the directory in the shell changes. And for other buffers I suppose the window title should show the directory and filename, or the buffer title. I often have multiple non-graphical emacs windows (frames?) open at once (e.g., via C-x 3).

Alternately, perhaps the window title should just have the user and host.

For that latter mode, the solution suggested in this thread might work, though as far as I can tell it has nothing directly to do with emacs (it's a modification to ssh).

For emacs proper I found references to, but that code is quite old (2009 or earlier) and I'm not confident it will work with relatively recent emacs.

There was also a long discussion "console-mode frame title sets Xterm title" in 2003 ( but I'm not sure what came of it, or how relevant it is (because I'm not sure what "frame title" refers to).

Thanks for any help.
Ross Boylan

reply via email to

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