[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: extension to mouse capabilities within xterm TTY frame

From: Olaf Rogalsky
Subject: Re: extension to mouse capabilities within xterm TTY frame
Date: Tue, 06 Jan 2015 02:02:02 +0100
User-agent: mu4e; emacs writes:

> Olaf Rogalsky <> writes:
>> I would like to bring to your attention two
>> extensions I wrote, relating the mouse support, when
>> used inside a xterm TTY frame.
> The "TTY"s are usually meant to be the Linux virtual
> terminals (VTs), or ttys, or simply "the console":
> those you get with Ctrl-Alt-F1, for example, for
> /dev/tty1, from X. (In a tty, you only need, say,
> Alt-F2 to go to tty2. Even that is bulky so check out
> [1] for how to rebind that.)
> Try tty(1) in a VT and it'll tell you /dev/tty3 for
> the third one, and so on (and in reverse).
> On many systems /dev/tty7 is used for X. If you
> disable the login manager (that will automatically
> start X) you get /dev/tty1 instead... and you can
> start X manually with xinit(1), after login! (Actually
> there is autologin - no password - for the ttys as
> well, for the bold and the impatient.)
> xterm, on the other hand, is... <drumroll> a terminal
> emulator for X! To confirm that xterm isn't a "real"
> tty, hit tty again (in xterm) and it says, perhaps,
> /dev/pts/9.
Yes, I know, xterm provides a pseudo-tele-type (pty). But in the source
code of emacs, all functions, which deal with tty's and pty's, have a
"tty" in their name. A very nice article, which explains the internals
and the history of the tty subsystem in UNIX can be found here:

> Cool! I would think most mouse users use the GUI Emacs
> in X. But as is evident, not all, so good work!
I never use the gui emacs. I am switching back and forth between several
instances of emacs and the shell with the job control commands from the
bash. I could do it the other way round with shell-mode, but I like it
as it is.

> That it doesn't use an external program is not an
> advantage, exactly. It depends.
Xclip (or xsel, or any of the other variants) is not installed
everywhere.  But I agree, its mostly a matter of taste. I just dislike
having a seperate program for such a fundamental thing like access to
the clipboard.

> And the DISPLAY variable is only needed for the "real"
> ttys? So does that apply to xterm?
The DISPLAY variable is needed to make a connection to the X-server. For
example, xsel uses DISPLAY to find out, to which X-server it shall
connect to (there may be several X-servers running, the X-server may be
on a remote computer). There is no X-server in a "real" tty, but if you
set DISPLAY to a running X-server (start X11 on vt7, switch back to vt1,
enter "export DISPLAY=:0" on the shell prompt), then xsel running on the
tty can access the X-servers clipboard (which of cause isn't very

In a purly tty environment without X11, tmux probably is a better

On the other hand, if I ssh to a remote host from a xterm without X11
forwarding (no DISPLAY), then xterm-clip still can access the clipboard
via xterm's control sequences.

> Anyway, good work! Keep it up.


Olaf Rogalsky
Schwörhausgasse 5
89073 Ulm

reply via email to

[Prev in Thread] Current Thread [Next in Thread]