Re: setting window title

From: Victor Wagner (vitus_at_45.free.net)
Date: 03/28/05


Date: Mon, 28 Mar 2005 14:13:02 +0000 (UTC)

Ulrich Eckhardt <doomster@knuut.de> wrote:
: junky_fellow@yahoo.co.in wrote:
: > Is there any way to set my window title equal to
: > my shell prompt "PS1" ?
: > If the "PS1" changes the (as I change directories) the
: > window title should also change.
: > I have set my PS1 to indicate hostname, present working directory
: > and the user name.
: There is a program called xttitle and some shells have another environment
: var called PROMPT_COMMAND.

This command just outputs simple escape sequence, which shell can just
as well output itself.

: BTW: you should deactivate this when not running under X, so a check for
: e.g. $XAUTHORITY is in place.

Better to check terminal type. If it is xterm* or rxvt*, then you can
use xterm-specific escape sequence.

Who have said you that thing would work only under X11?

There is for example, win32 terminal emulator putty, which support this
sequence among other xterm-specific things. It sets TERM variable to
xterm.

: All this assuming you're talking about X11 terminals, which you never said
: though....

And this is correct, because it would work under Windows too. May be it
would also work under MacOS if you find good terminal emulator for it.
If there is shell WINDOW and it have a title, somebody would write
support for this escape sequence eventually.

-- 


Relevant Pages

  • RE: Opening Access database
    ... Here's a Shell function method, but it will give you limited automation ... You can then control the application using Access objects and methods, ... maximizes the project window within the Access main window, ... then that app will receive the keystrokes. ...
    (microsoft.public.excel.programming)
  • Re: Custom shell window management
    ... there and change all window attributes to remove system buttons and system menu items ... Another quick and dirty workaround would be to handle WM_ACTIVATE event for your shell app window and, ... I'd recommend you to create your shell app with CreateWindowEx API with the WS_EX_NOACTIVATE ex-style set. ... that seem common to custom shell creation. ...
    (microsoft.public.windowsxp.embedded)
  • Re: More difficult question - how do I wait until another application closes?
    ... Rick Rothstein wrote: ... another window. ... This method doesn't use Shell -- it uses CreateProcessA (and provides ... Private Declare Function OpenProcess _ ...
    (comp.lang.basic.visual.misc)
  • Re: Booting right into my Application at startup
    ... handled, normally, by the taskbar. ... You can't call shell APIs before the shell is running! ... just for a moment, other than having your window come up, taking up the ... hidden via the registry keys? ...
    (microsoft.public.windowsce.embedded)
  • Old Subject: Explorer Messages
    ... So I'm still pluggin away at the shell replacement. ... does anyone have any more info on SetShellWindow? ... If Explorer is running and I call GetShellWindow, ... indicating that nothing is set as the shell window. ...
    (microsoft.public.vb.winapi)