Xref: utzoo comp.windows.x:27719 comp.unix.shell:399 comp.unix.questions:25941 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!milano!cadillac!Pkg.Mcc.COM!harp From: harp@Pkg.Mcc.COM (Christopher North-Keys) Newsgroups: comp.windows.x,comp.unix.shell,comp.unix.questions Subject: Re: Title bar flicker fix for XTerm [setting title only on "cd"] Keywords: XTerm patch flicker title bar Message-ID: <1990Oct2.232740@Pkg.Mcc.COM> Date: 3 Oct 90 04:27:40 GMT References: <6459@vanuata.cs.glasgow.ac.uk> <28434@pasteur.Berkeley.EDU> <1990Oct3.011511.2263@mlb.semi.harris.com> Sender: news@cadillac.CAD.MCC.COM Reply-To: harp@Pkg.Mcc.COM (Christopher North-Keys) Organization: Group Talisman Lines: 110 In article <1990Oct3.011511.2263@mlb.semi.harris.com>, geg@beep.mlb.semi.harris.com (Greg Garland) writes: | In article <28434@pasteur.Berkeley.EDU>, stolcke@ICSI.Berkeley.EDU (Andreas Stolcke) writes: | |> In article <6459@vanuata.cs.glasgow.ac.uk>, sinclair@cs.glasgow.ac.uk (Duncan Sinclair) writes: | |> |> Using tcsh, I set re-set the title of xterm before each shell prompt, | |> May I suggest a different approach to the same end. Instead of | |> having the tcsh prompt string set the title bar on every command, | |> alias the `cd ' command so as to set it only when actually changing the | |> current directory. (This should work for any shell with something equivalent | |> to an aliasing mechanism). | |> | | Better call it something besides 'cd', though, like 'xcd'. I called it 'cd' | originally, but I noticed that when I ran sunview (to use some non-X stuff) | the escape sequences seem to cause the SunView 'shelltool's to hang. | | Greg G. DISCLAIMER: If there's an obviously better way in the Csh, just *tell* me, eh? Try making the alias "c", and then, in your .cshrc startup scripts, set the directory-echo alias (here, ".") appropriately for the window system. Possible approaches: X windows: DISPLAY should exist, and TERM will be "xterm" Sunview: WINDOW_PARENT should exist, and TERM will be "sun" or "sun-cmd" An example (condensed from the elfshell, version 29) using $term: --------- setenv esc '^[' # an escape char setenv bel '^G' # a bell char setenv HOSTNAME `hostname` setenv HOSTNICK `expr $HOSTNAME : '\([A-Za-z0-9-]*\)\..*' \| $HOSTNAME` if ($?tcsh) then alias c 'cd \!*' # Don't alias this to "cd"---bad. alias cwdcmd . # This arranges for "cd" to update the title as well. else alias c 'cd \!* ; .' # Don't alias this to "cd"---bad. endif if (! $?term) set term = '' # fall through to default. switch ("$term") case "sun*": alias . 'header [-${HOSTNICK}- `dirs` ]' alias header 'echo -n "$esc]l\!*$esc\"' alias iheader 'echo -n "$esc]L\!*$esc\"' alias icon 'echo -n "$esc]I\!*$esc\"' breaksw case "xterm": alias . 'header [-${HOSTNICK}- `dirs` ];iheader ${HOSTNICK}: $cwd:t' alias header 'echo -n "$esc]2;\!*$bel"' alias iheader 'echo -n "$esc]1;\!*$bel"' alias icon 'echo -n "$esc]I;\!*$bel"' breaksw default: alias . 'dirs' set term = `tset - -I -Q -r -m :\?vt100` breaksw endsw --------- Other aliases, some using environment variables. Note that EDITOR gets reset by sunview and X startup scripts to be emacsclient instead of vi. alias .. 'cd ..; .' alias ... 'cd $cwd:h ; .' # A neat trick to move to the *logical* parent. alias / 'clear ; .' # Root of screen (?) alias ~ 'cd ~\!* ; .' alias j 'jobs -l' alias p '$PAGER' alias h 'history -r | p' alias f 'fg %\!:1' alias y '$EDITOR' # "yank" (was "warp") for emacsclient program alias ]d 'pushd \!* ; .' alias [d 'popd ; .' # Be verra careful not t'hide the system rm --- should NOT be a script. alias rm 'ls -Fsd \!*; echo -n "remove? "; if ("$<" == "y") /bin/rm \!*' -- ________________________________________________________________________ _______ Christopher Alex.North-Keys Associate Systems Analyst Group Talisman Harp[@Mcc.Com] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~