home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / ultrix / 8386 < prev    next >
Encoding:
Text File  |  1992-11-18  |  1.6 KB  |  56 lines

  1. Newsgroups: comp.unix.ultrix
  2. Path: sparky!uunet!sun-barr!decwrl!pa.dec.com!nntpd2.cxo.dec.com!nntpd.lkg.dec.com!news!dcoleman
  3. From: dcoleman@acoustic.aosg.gsf.dec.com (David M. Coleman AOSG)
  4. Subject: Re: Q: escape sequences to modify dxterm title?
  5. Message-ID: <1992Nov17.214958.9727@aosg.gsf.dec.com>
  6. Keywords: xterm dxterm escape codes
  7. Sender: usenet@aosg.gsf.dec.com (USENET News System)
  8. Nntp-Posting-Host: acoustic.aosg.gsf.dec.com
  9. Organization: AOSG
  10. References:  <1992Nov16.105312.19054@Informatik.TU-Muenchen.DE>
  11. Date: Tue, 17 Nov 1992 21:49:58 GMT
  12. Lines: 42
  13.  
  14. In article <1992Nov16.105312.19054@Informatik.TU-Muenchen.DE>, kirschnt@Informatik.TU-Muenchen.DE (Torsten R. Kirschner) writes:
  15. |> can anybody tell me whether there are xterm-like escape sequences to
  16. |> modify a dxterm's titlebar string dynamically??
  17.  
  18.     Here's a csh script that'll work with either xterm or dxterm:
  19.  
  20. #!/bin/csh
  21. #
  22. # dtitle    - Set  title for terminal window and icon
  23. #
  24.  
  25. set    window_title    = $1
  26. set    icon_title    = $2
  27. if (${icon_title} == "") then
  28.     set icon_title = $window_title
  29. endif
  30.  
  31. #
  32. # xterm title
  33. #
  34. set    esc    = ""
  35. set    ctrl_G    = ""
  36. set    do_window = 2
  37. set    do_icon    = 1
  38.  
  39. set    title_window    = "${esc}]${do_window};${window_title}${ctrl_G}"
  40. set    title_icon    = "${esc}]${do_icon};${icon_title}${ctrl_G}"
  41. set    title_xterm    = "${title_window}${title_icon}"
  42.  
  43. #
  44. # dxterm title
  45. #
  46. set    osc    = "¥"
  47. set    st    = "£"
  48. set    title_dxterm    = "${osc}21;${window_title}${st}${osc}2L;${icon_title}${st}"
  49.  
  50. if ($TERM == "xterm") then
  51.     echo "Setting xterm title ... " ${title_xterm}
  52. else
  53.     echo "Setting xterm title ... " ${title_xterm} \
  54.     " or dxterm title ..." ${title_dxterm}
  55. endif
  56.