Changing xterm title.

Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default Changing xterm title.

    I have an ncurses based application that changes the xterm title to the
    current working directory. I was using printf statements and escape
    characters to change the title but if the program is running inside of
    the screen program that will not work. I changed the program to use Xlib
    calls but I am not sure if I am doing it correctly or not.

    This works but I am wondering if there is a better way.

    void
    change_term_title(char * new_title)
    {
    Display *dsp = NULL;
    Window win = 0;
    XTextProperty prop;

    XStringListToTextProperty(&new_title, 1, &prop);
    dsp = XOpenDisplay(NULL);
    win = atol(getenv("WINDOWID");

    XSetWMName(dsp, win, &prop);
    XFlush(dsp);
    XFree(prop.value);
    XCloseDisplay(dsp);
    }

    I have never done any Xlib programming and I don't know how portable this
    code is. I realize that the code needs some error checking, but I am
    wondering if I am on the right track or if there is a better way of doing
    this.

    Thanks,
    Ken


    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    [url]http://www.newsfeeds.com[/url] - The #1 Newsgroup Service in the World!
    -----== Over 80,000 Newsgroups - 16 Different Servers! =-----
    Ken Steen Guest

  2. Similar Questions and Discussions

    1. Changing Admin Page Title
      Can you change the page title displayed in CF Admin so it says "Coldfusion Administrator- DEV" when on a dev server? I tried opening the index file...
    2. Changing the title bar and URL
      Hi , I am using Frames in my website, all is well except for one thing. The page title and the URL (in the address bar) stays the same. It always...
    3. Show information in xterm title bar
      I am using Xterm on Solaris 2.8 via Exceed. I like to run ksh. I would like to display details such as, my current userid, server, current...
    4. Changing Browser Title Bar in MM_openBrWindow?
      I used presentation pro's converter to convert my powerpoints to flash. In DMX I am able to launch a flash piece in a new window using the onClick...
    5. bash: display running foreground command in xterm title
      How can I get bash to display the currently running command (at least the foreground process) in the titlebar of an xterm? All I'm finding on Google...
  3. #2

    Default Re: Changing xterm title.

    Ken Steen wrote:
    > I have an ncurses based application that changes the xterm title to the
    > current working directory. I was using printf statements and escape
    > characters to change the title but if the program is running inside of
    > the screen program that will not work.
    [...]

    You can put this in your ~/.screenrc:

    termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]0;xterm\007'

    --
    Stéphane
    Stephane CHAZELAS Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139