xterm pointer resource
Tim Writer
tim-s/rLXaiAEBtBDgjK7y7TUQ at public.gmane.org
Wed Jan 14 01:58:54 UTC 2004
David Tilbrook <dt-hKuJ9UrQZDM at public.gmane.org> writes:
> Tim Writer wrote:
> <snip>
> > ... And I
>
> > can get all the fancy multi-screen features (and more) by running screen
> > inside xterm (which I routinely do).
> >
>
> I know that xterm can support multi-screen features as I have qed
> commands to do so, but I presume that you have some other ways
> of using them.
>
> How? Pointers please.
I don't use any builtin multi-screen features of xterm, at least not
directly. AFAIK, xterm's builtin multi-screen support is limited to a
graphics (Tektronix IIRC) emulation as well as a separate context for full
screen (e.g. curses etc. based) apps like vi, emacs, and so on.
I simply run screen inside in xterm, i.e:
xterm -name screen -e screen
The only purpose of "-name screen" is to invoke this X resource:
screen*saveLines: 0
since (screen has its own buffer) although you could do other customizations
specific to screen. I also use class based resources (i.e. XTerm not xterm)
to configure my xterms so I don't have to duplicate my settings for screen
too.
In addition, I have a simple screenrc that looks like this:
defscrollback 1000
escape '^]]'
startup_message off
# Use hard status facility to display window number and title in title
# bar. Also displays the stored hard status which can be set by the
# application using an escape sequence. See
# ~/lib/zsh/term.d/screen/set-window-title for an example.
hardstatus on
hardstatus string "[%n %t]%? %h%?"
I use zsh as my shell and in ~/lib/zsh/term.d/$TERM I have functions specific
to a given terminal. The set-window-title function looks like this:
function set-window-title {
print -n "\033]0;$*\007"; # hardstatus
}
which just issues the escape code that tells screen to set its stored
hardstatus to the arguments. IOW,
set-window-title HELLO WORLD
set screen's stored hardstatus to "HELLO WORLD" which replaces the "%h" in
the hardstatus string above which screen stores in the xterm title bar. My
zsh startup scripts arrange for set-window-title to be called with the
hostname and working directory whenever it changes. The net result of this
is my xterm title bar contains:
[0 zsh] halley:~
when I first start it. If I cd to Mail in that shell, it will have:
[0 zsh] halley:~/Mail
and so on.
This line in my screenrc:
escape '^]]'
just changes screen's default escape character. I use the old telnet escape
character because I hardly ever use telnet, it doesn't conflict with
anything, and it's easy (for me) to remember. When focus is in my xterm, I
just press:
^]c
to start a second shell running within screen within the same xterm. When
the second shell is active, the xterm title bar contains:
[1 zsh] halley:~
I can flip back to the first shell with:
^]0
and back to the second with:
^]1
You get the idea.
You're not restricted to starting shells, you can start an arbitrary command
via the screen commmand (which acts differently when run from within
screen). So, running:
screen pine
runs the pine MUA within a new screen "window".
None of this interferes with screen's ability to detach from and reattach to
running sessions. If you want to go home and leave some stuff running, you
can just:
^]d
which will detach screen, exiting xterm. To reattach:
xterm -name screen -e screen -R
I find this is a great way to work, I don't know I managed without it.
--
tim writer <tim-s/rLXaiAEBtBDgjK7y7TUQ at public.gmane.org> starnix inc.
905.771.0017 ext. 225 thornhill, ontario, canada
http://www.starnix.com professional linux services & products
--
The Toronto Linux Users Group. Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
More information about the Legacy
mailing list