comparison README.multi-tty @ 53341:d4e6a050c9b1

Bugfix festival. lib-src/emacsclient.c (main_argc, main_argv): New variables. (main): Initialize them. (fail): Use them. (window_change, copy_from_to): Don't kill if emacs_pid is zero. (pty_conversation): Watch the command socket, too. Read emacs_pid here. Emacs and emacsclient could deadlock if Emacs tried to do a reset_sys_modes before sending its pid. lisp/server.el: Automatically delete the client frame when done editing. (server-frames): New variable. (server-process-filter, server-sentinel, server-buffer-done): Use it. (server-process-filter): Do a redisplay before evaluating other parameters. (Prevents "emacsclient -h -e '(delete-frame)'" from messing up the system. src/dispextern.h: Update prototypes. src/dispnew.c (window_change_signal): Do nothing if !term_initted. (init_display): Set the frame size from the tty data after term_init. src/emacs.c (main): Make sure things that init_sys_modes needs are initialized before init_display (which calls init_sys_modes now). (sort_args): Use xfree, not free. (shut_down_emacs) [!EMACS_HAVE_TTY_PGRP]: Use reset_all_sys_modes instead of reset_sys_modes. src/frame.c (make_terminal_frame): Sigh. Move terminal initialization back to the middle of frame setup. Handle errors by making sure that the delete_tty() called from term_init() will see and delete this frame. (Fdelete_frame): Kill the frame before calling delete_tty(). Fix condition for tty deletion. src/keyboard.c (Fset_input_mode): Use reset_sys_modes on the current terminal only. src/lisp.h: Remove duplicate prototypes. src/msdos.c (croak): use reset_all_sys_modes(). src/sysdeps.c (init_baud_rate): Added tty parameter, use it instead of CURTTY. (child_setup_tty): Reset sigio on stdin, not CURTTY(). (reset_sigio): Added fd parameter, put explicit fcntl there. (request_sigio, unrequest_sigio)[FASYNC]: Simply block/unblock the SIGIO signal, don't touch the file params. There are multiple ttys now, and we can't disable the SIGIO from emacsclient. (get_tty_size)[VMS]: Use tty_out instead of CURTTY(). (reset_sys_modes): Don't call cursor_to, clear_end_of_line; call cmgoto and tty_clear_end_of_line instead. The frame may already be dead. Updated reset_sigio call. src/term.c (clear_and_of_line): Separate tty-dependent stuff to tty_clear_end_of_line() for reset_sys_modes. (tty_clear_end_of_line): New function. (term_init): Added frame parameter, don't use selected_frame. Set the frame's output_data.tty value (in case there is an error later). Set the frame size in Wcm, not in the frame. Only free the termcap buffer if there is a termcap-related error. Call init_sys_modes last, not first. (deleting_tty): New variable. (delete_tty): Use it for handling recursive calls. Free deleted tty, except its Wcm (there is still a dangling reference somewhere). git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-19
author Karoly Lorentey <lorentey@elte.hu>
date Mon, 29 Dec 2003 07:16:26 +0000
parents db645482d6bc
children 56e4b7166995
comparison
equal deleted inserted replaced
53340:db645482d6bc 53341:d4e6a050c9b1
65 65
66 ** Support for multiple terminal devices has been added. You can 66 ** Support for multiple terminal devices has been added. You can
67 specify a terminal device (`tty' parameter) and a terminal type 67 specify a terminal device (`tty' parameter) and a terminal type
68 (`tty-type' parameter) to `make-terminal-frame'. `tty' must be a 68 (`tty-type' parameter) to `make-terminal-frame'. `tty' must be a
69 terminal device created by the updated emacsclient, or there will 69 terminal device created by the updated emacsclient, or there will
70 be problems with terminal input and window resizes. (The kernel 70 be problems with terminal input and window resizes.
71 notifies processes about pending input or terminal resizes only on
72 the controlling terminal, so we need emacsclient to sit on the real
73 terminal device, create SIGIO signals upon terminal input, and
74 forward SIGWINCH signals to us.)
75 71
76 You can test for the presence of multiple terminal support by 72 You can test for the presence of multiple terminal support by
77 testing for the `multi-tty' feature. 73 testing for the `multi-tty' feature.
78 74
79 ** A make-frame-on-tty function has been added to make it easier to 75 ** A make-frame-on-tty function has been added to make it easier to
158 154
159 (Done, emacsclient signals Emacs after writing to the proxy pseudo 155 (Done, emacsclient signals Emacs after writing to the proxy pseudo
160 terminal. Note that this means that multi-tty does not work with 156 terminal. Note that this means that multi-tty does not work with
161 raw ttys!) 157 raw ttys!)
162 158
159 (Update: This is bullshit. There is a read_input_waiting function,
160 extend that somehow.)
161
163 -- Make make-terminal-frame look up the `tty' and `tty-type' frame 162 -- Make make-terminal-frame look up the `tty' and `tty-type' frame
164 parameters from the currently selected terminal before the global 163 parameters from the currently selected terminal before the global
165 default. 164 default.
166 165
167 (Done.) 166 (Done.)
189 -- Implement automatic deletion of terminals when the last frame on 188 -- Implement automatic deletion of terminals when the last frame on
190 that terminal is closed. 189 that terminal is closed.
191 190
192 (Done.) 191 (Done.)
193 192
193 -- Restore tty screen after closing the terminal.
194
195 (Done, we do the same as Emacs 21.2 for all terminals.)
196
197 -- 'TERM=dumb src/emacs' does not restore the terminal state.
198
199 (Done.)
194 200
195 THINGS TO DO 201 THINGS TO DO
196 ------------ 202 ------------
197 203
198 ** Fix mysterious memory corruption error with tty deletion. To 204 ** Fix mysterious memory corruption error with tty deletion. To
214 ** Change emacsclient/server.el to support the -h argument better, 220 ** Change emacsclient/server.el to support the -h argument better,
215 i.e. automatically close the socket when the frame is closed. 221 i.e. automatically close the socket when the frame is closed.
216 222
217 ** Export delete_tty to the Lisp environment, for emacsclient. 223 ** Export delete_tty to the Lisp environment, for emacsclient.
218 224
219 ** Restore tty screen after closing the terminal.
220
221 ** 'TERM=dumb src/emacs' does not restore the terminal state.
222
223 ** C-g should work on secondary terminals. 225 ** C-g should work on secondary terminals.
224 226
225 ** Make parts of struct tty_output accessible from Lisp. The device 227 ** Make parts of struct tty_output accessible from Lisp. The device
226 name and the type is sufficient. 228 name and the type is sufficient.
227 229
228 ** Find out why does Emacs abort when it wants to close its 230 ** Find out why does Emacs abort when it wants to close its
229 controlling tty. 231 controlling tty. Hint: chan_process[] array. Hey, maybe
232 noninterrupt-IO would work, too?
230 233
231 ** Implement support for starting an interactive Emacs session without 234 ** Implement support for starting an interactive Emacs session without
232 an initial frame. (The user would connect to it and open frames 235 an initial frame. (The user would connect to it and open frames
233 later, with emacsclient.) Not necessarily a good idea. 236 later, with emacsclient.) Not necessarily a good idea.
234 237
235 ** Support raw secondary terminals. (This one is tricky, SIGIO works 238 ** Support raw secondary terminals. (Note that SIGIO works only on
236 only on the controlling terminal. The emacsclient solution works 239 the controlling terminal.) Hint: extend read_input_waiting() for
237 nicely, so this is not that important anyway.) 240 multiple ttys and hopefully this will be fixed.
238 241
239 ** What does interrupt_input do? I tried to disable it for raw 242 ** What does interrupt_input do? I tried to disable it for raw
240 secondary tty support, but it does not seem to do anything useful. 243 secondary tty support, but it does not seem to do anything useful.
241 244
245 ** Issue with SIGIO: it needs to be disabled during redisplay. See if
246 fcntl() kernel behaviour could be emulated by emacsclient.
247
242 ** Move optimalization parameters (costs) from union output_data to 248 ** Move optimalization parameters (costs) from union output_data to
243 a backend-neutral per-device structure. 249 a backend-neutral per-device structure.
244 250
245 ** Find out the best way to support suspending Emacs with multiple 251 ** Find out the best way to support suspending Emacs with multiple
246 ttys. 252 ttys.
247 253
254 ** Deal with SIGHUP in Emacs and in emacsclient. (After this, the
255 server-frames may be removed from server.el.)
256
248 ** Do tty output through term_hooks, like all other display backends. 257 ** Do tty output through term_hooks, like all other display backends.
249 258
250 ** Fix X support. 259 ** Fix X support.
251 260
252 ** Allow simultaneous X and tty frames. 261 ** Allow simultaneous X and tty frames.