Full support for multiple terminal I/O (with some rough edges).
[bpt/emacs.git] / README.multi-tty
CommitLineData
28d440ab
KL
1 -*- coding: utf-8; -*-
2GOAL
3----
4
5The ultimate goal of this branch is to implement support for opening
6multiple, different tty devices and simultaneous X and tty frames from
7a single Emacs session.
8
9WHO IS DOING IT
10---------------
11
12I'm Károly Lőrentey. My address: lorentey@elte.hu.
13
14Patches or suggestions are welcome!
15
6548cf00 16Retrieving the latest version of the branch:
4f0359de
KL
17
18 tla register-archive lorentey@elte.hu--2004 http://lorentey.web.elte.hu/arch/2004/
19 tla get lorentey@elte.hu--2004/emacs--multi-tty--0 <directory>
20
21(I use tla 1.1.)
22
28d440ab
KL
23
24STATUS
25------
26
6548cf00
KL
27Basic support is there; there are some rough edges, but it already
28seems to be usable. Input is read from all terminals (NOT via
29MULTIKBOARD!). At the moment, the type of the new terminals must be
30the same as the initial terminal. Emacsclient was extended to support
31opening a new terminal frame.
28d440ab 32
9628b887 33To try it out, start up the emacs server (M-x server-start), and then
6548cf00 34(from a shell prompt on another terminal) start emacsclient with
28d440ab 35
9628b887 36 emacsclient -h
28d440ab 37
6548cf00
KL
38You'll have two fully working frames on separate terminals. If you
39exit emacs, both terminals should be restored to their previous
9628b887 40states.
28d440ab 41
6548cf00
KL
42X, Mac, Windows and DOS support is broken at the moment.
43
44Tested under GNU/Linux only.
28d440ab
KL
45
46NEWS
47----
48
49For the NEWS file:
50
51** Support for multiple terminal devices has been added. You can
52 specify a terminal device (`tty' parameter) and a terminal type
6548cf00
KL
53 (`tty-type' parameter) to `make-terminal-frame'. `tty' must be a
54 terminal device created by the new emacsclient, or there will be
55 problems with terminal input and window resizes. (The kernel
56 notifies processes about pending input or terminal resizes only on
57 the controlling terminal, so we need emacsclient to sit on the real
58 terminal device, create SIGIO signals upon terminal input, and
59 forward SIGWINCH signals to us.)
60
61 You can test for the presence of multiple terminal support by
62 testing for the `multi-tty' feature.
63
64** A make-frame-on-tty function has been added to make it easier to
65 create frames on new terminals.
28d440ab 66
9628b887
KL
67** Emacsclient has been extended to support opening a new terminal
68 frame.
28d440ab
KL
69
70CHANGELOG
71---------
72
73See arch logs.
74
75
6548cf00
KL
76DIARY OF CHANGES
77----------------
78
79(ex-TODO items with explanations.)
28d440ab
KL
80
81-- Introduce a new abstraction for terminal devices.
82
83 (Done, see struct tty_output. The abstraction is not yet
84 complete.)
85
86
87-- Change the bootstrap procedure to initialize tty_list.
88
89 (Done, but needs review.)
90
91
92-- Change make-terminal-frame to support specifying another tty.
93
94 (Done, new frame parameters: `tty' and `tty-type'.)
95
96
9628b887
KL
97-- Implement support for reading from multiple terminals.
98
99 (Done, read_avail_input tries to read from each terminal, until one
6548cf00
KL
100 succeeds. MULTIKBOARD is not used. Secondary terminals don't send
101 SIGIO!)
9628b887
KL
102
103-- other-frame should cycle through the frames on the `current'
6548cf00 104 terminal only.
9628b887 105
6548cf00 106 (Done, by trivially modifiying next_frame and prev_frame.)
9628b887
KL
107
108-- Support different terminal sizes.
109
110 (Done, no problem.)
111
112-- Make sure terminal resizes are handled gracefully. (Could be
113 problematic.)
114
6548cf00
KL
115 (Done. We don't get automatic SIGWINCH for additional ttys,
116 though.)
9628b887
KL
117
118-- Extend emacsclient to automatically open a new tty when it connects
119 to Emacs.
120
121 (Done. It's an ugly hack, needs more work.)
122
123-- Redisplay must refresh the topmost frame on all terminals, not just
124 the initial terminal.
125
126 (Done, but introduced ugly redisplay problems. Ugh.)
127
6548cf00
KL
128-- Fix redisplay problems.
129
130 (Done, it turned out that the entire Wcm structure must be moved
131 inside tty_output. Why was it so hard for me to find this out?)
132
133-- Provide a way for emacsclient to tell Emacs that the tty has been
134 resized.
135
136 (Done, simply forward the SIGWINCH signal.)
137
138-- Each keypress should automatically select the frame corresponding
139 to the terminal that it was coming from. This means that Emacs
140 must know from which terminal the last keyboard event came from.
141 (Multikeyboard support may help with this.)
142
143 (Done, it was quite simple.)
144
145-- Fix SIGIO issue with secondary terminals.
146
147 (Done, emacsclient signals Emacs after writing to the proxy pseudo
148 terminal. This means that multi-tty does not work with raw ttys!)
9628b887 149
28d440ab
KL
150THINGS TO DO
151------------
152
6548cf00
KL
153** Implement sane error handling after initialization. (Currently
154 emacs exits if you specify a bad terminal type.) The helpful error
155 messages must still be provided when Emacs starts.
156
157** C-g should work on secondary terminals.
9628b887 158
28d440ab
KL
159** Make make-terminal-frame look up the tty and tty-type parameters
160 from the currently selected terminal before the global default.
161
162** Move optimalization parameters (costs) from union output_data to
6548cf00 163 a backend-neutral per-device structure.
28d440ab 164
6548cf00
KL
165** Implement terminal deletion, i.e., deleting local frames, closing
166 the tty device and restoring its previous state without exiting
167 Emacs. This should be exported to the Lisp environment.
9628b887 168
6548cf00 169** Implement automatic deletion of terminals when the last frame on
28d440ab
KL
170 that terminal is closed.
171
172** Put all cached terminal escape sequences into struct tty_output.
173 Currently, they are still stored in global variables, so we don't
174 really support multiple terminal types.
175
6548cf00
KL
176** Make parts of struct tty_output accessible from Lisp. The device
177 name and the type is sufficient.
28d440ab 178
28d440ab
KL
179** Implement support for starting an interactive Emacs session without
180 an initial frame. (The user would connect to it and open frames
181 later, with emacsclient.) Not necessary a good idea.
182
6548cf00
KL
183** Support raw secondary terminals. (This one is tricky, SIGIO works
184 only on the controlling terminal.)
185
186** What does interrupt_input do? I tried to disable it for raw
187 secondary tty support, but it seems not to do anything useful.
188
28d440ab
KL
189** Fix X support.
190
6548cf00
KL
191** Do tty output through term_hooks, too.
192
28d440ab
KL
193** Allow simultaneous X and tty frames.
194
195** Fix Mac support (I can't do this myself).
196
197** Fix W32 support (I can't do this myself).
198
199** Fix DOS support (I can't do this myself).
200
201
202
203;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d