5 The ultimate goal of this branch is to implement support for opening
6 multiple, different tty devices and simultaneous X and tty frames from
7 a single Emacs session.
12 I'm Károly Lőrentey. My address: lorentey@elte.hu.
14 Patches or suggestions are welcome!
16 Retrieving the latest version of the branch:
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>
27 Basic support is there; there are some rough edges, but it already
28 seems to be usable. Input is read from all terminals (NOT via
29 MULTIKBOARD!). At the moment, the type of the new terminals must be
30 the same as the initial terminal. Emacsclient was extended to support
31 opening a new terminal frame.
33 To try it out, start up the emacs server (M-x server-start), and then
34 (from a shell prompt on another terminal) start emacsclient with
38 You'll have two fully working frames on separate terminals. If you
39 exit emacs, both terminals should be restored to their previous
42 X, Mac, Windows and DOS support is broken at the moment.
44 Tested under GNU/Linux only.
51 ** Support for multiple terminal devices has been added. You can
52 specify a terminal device (`tty' parameter) and a terminal type
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.)
61 You can test for the presence of multiple terminal support by
62 testing for the `multi-tty' feature.
64 ** A make-frame-on-tty function has been added to make it easier to
65 create frames on new terminals.
67 ** Emacsclient has been extended to support opening a new terminal
79 (ex-TODO items with explanations.)
81 -- Introduce a new abstraction for terminal devices.
83 (Done, see struct tty_output. The abstraction is not yet
87 -- Change the bootstrap procedure to initialize tty_list.
89 (Done, but needs review.)
92 -- Change make-terminal-frame to support specifying another tty.
94 (Done, new frame parameters: `tty' and `tty-type'.)
97 -- Implement support for reading from multiple terminals.
99 (Done, read_avail_input tries to read from each terminal, until one
100 succeeds. MULTIKBOARD is not used. Secondary terminals don't send
103 -- other-frame should cycle through the frames on the `current'
106 (Done, by trivially modifiying next_frame and prev_frame.)
108 -- Support different terminal sizes.
112 -- Make sure terminal resizes are handled gracefully. (Could be
115 (Done. We don't get automatic SIGWINCH for additional ttys,
118 -- Extend emacsclient to automatically open a new tty when it connects
121 (Done. It's an ugly hack, needs more work.)
123 -- Redisplay must refresh the topmost frame on all terminals, not just
124 the initial terminal.
126 (Done, but introduced ugly redisplay problems. Ugh.)
128 -- Fix redisplay problems.
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?)
133 -- Provide a way for emacsclient to tell Emacs that the tty has been
136 (Done, simply forward the SIGWINCH signal.)
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.)
143 (Done, it was quite simple.)
145 -- Fix SIGIO issue with secondary terminals.
147 (Done, emacsclient signals Emacs after writing to the proxy pseudo
148 terminal. This means that multi-tty does not work with raw ttys!)
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.
157 ** C-g should work on secondary terminals.
159 ** Make make-terminal-frame look up the tty and tty-type parameters
160 from the currently selected terminal before the global default.
162 ** Move optimalization parameters (costs) from union output_data to
163 a backend-neutral per-device structure.
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.
169 ** Implement automatic deletion of terminals when the last frame on
170 that terminal is closed.
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.
176 ** Make parts of struct tty_output accessible from Lisp. The device
177 name and the type is sufficient.
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.
183 ** Support raw secondary terminals. (This one is tricky, SIGIO works
184 only on the controlling terminal.)
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.
191 ** Do tty output through term_hooks, too.
193 ** Allow simultaneous X and tty frames.
195 ** Fix Mac support (I can't do this myself).
197 ** Fix W32 support (I can't do this myself).
199 ** Fix DOS support (I can't do this myself).
203 ;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d