Merged in changes from CVS trunk.
[bpt/emacs.git] / README.multi-tty
CommitLineData
3224dac1 1 -*- coding: utf-8; mode: text; -*-
28d440ab
KL
2GOAL
3----
4
2246281f
KL
5The goal of this branch is to implement support for opening multiple,
6different tty devices and simultaneous X and tty frames from a single
7Emacs session.
28d440ab 8
7b00d185 9Some use cases:
7b00d185
KL
10Emacs is notoriously slow at startup, so most people use another
11editor or emacsclient for quick editing jobs from the console.
12Unfortunately, emacsclient was very awkward to use, because it did not
13support opening a new Emacs frame on the current virtual console.
14Now, with multi-tty support, it can do that. (Emacsclient starts up
15faster than vi!)
16
17Some Gnus users (including me) run Gnus in an X frame in its own Emacs
18instance, which they typically leave running for weeks. It would be
19nice if they could connect to this instance from a remote ssh session
20and check their messages without opening a remote X frame or resorting
21to gnus-slave.
22
28d440ab
KL
23WHO IS DOING IT
24---------------
25
26I'm Károly Lőrentey. My address: lorentey@elte.hu.
27
2246281f 28Comments, bug reports, suggestions and patches are welcome!
28d440ab 29
6548cf00 30Retrieving the latest version of the branch:
4f0359de
KL
31
32 tla register-archive lorentey@elte.hu--2004 http://lorentey.web.elte.hu/arch/2004/
daf01701 33 tla get lorentey@elte.hu--2004/emacs--multi-tty <directory>
4f0359de 34
7b00d185
KL
35(I use a recent arch development snapshot, but any of the released
36versions of arch will do fine, I think.)
37
6ad9aaa9
KL
38To update your source tree to the latest revision after the first
39checkout, simply use the following command:
40
41 tla replay lorentey@elte.hu--2004/emacs--multi-tty--0
42
43If you are interested, you can find more detailed information about
44Arch on http://wiki.gnuarch.org/. It's a wonderful source control
45system, I highly recommend it.
46
7b00d185
KL
47If you don't have arch, the branch has a homepage from which you can
48download conventional patches against Emacs CVS HEAD:
4f0359de 49
7b00d185 50 http://lorentey.web.elte.hu/project/emacs.html
28d440ab 51
6c3d443b
KL
52If you want to be notified of new revisions, sign up to the
53multi-tty@listbox.elte.hu mailing list by visiting the
54below homepage and following its instructions.
55
56 https://listbox.elte.hu/mailman/listinfo/multi-tty
57
58Please note that the multi-tty mailing list is read-only, and is
59reserved for automatic commit messages. Discussion about the branch
60and bug reports should be sent directly to me (lorentey@elte.hu), or
aaaf7fe1
KL
61to the emacs-devel@gnu.org mailing list. (I hope to merge my branch
62into CVS HEAD reasonably soon, so I don't want to set up an elaborate
63development infrastructure for the multi-tty branch.)
6c3d443b 64
28d440ab
KL
65STATUS
66------
67
bacb6689
KL
68The branch is now very stable and almost full-featured. I hope the
69major problems were fixed. (It still needs testing on other
70architectures, though.) Both multiple tty device support and
71simultaneous X and tty frame support works fine. Emacsclient has been
aaaf7fe1
KL
72extended to support opening new tty and X frames. It has been changed
73open new Emacs frames by default.
2246281f 74
2246281f 75Please let me know if you find any bugs in this branch.
28d440ab 76
0c72d684
KL
77HOW TO COMPILE AND TEST
78-----------------------
79
aaaf7fe1
KL
80To try out the multi-tty branch, compile and run the multi-tty branch
81with the following commands:
bc279d67 82
2a0c7b06 83 find -name "*.elc" | xargs rm # Delete leftover stuff
bc279d67
KL
84 mkdir +build
85 cd +build
0c72d684 86 ../configure <your favourite options>
bc279d67 87 make bootstrap
2246281f 88 src/emacs -nw # You can also try without -nw
7b00d185 89 M-x server-start
bc279d67 90
7b00d185
KL
91and then (from a shell prompt on another terminal) start emacsclient
92with
aaaf7fe1
KL
93 lib-src/emacsclient /optional/file/names...
94or
7b00d185 95 lib-src/emacsclient -t /optional/file/names...
28d440ab 96
04c3243c 97You'll hopefully have two fully working, independent frames on
7b00d185 98separate terminals. The new frame is closed automatically when you
2a0c7b06
KL
99finish editing the specified files (C-x #), but delete-frame (C-x 5 0)
100also works. Of course, you can create frames on more than two tty
101devices.
52c2ee2a 102
7b00d185
KL
103Creating new frames on the same tty with C-x 5 2 works, and they
104behave the same way as in previous Emacs versions. If you exit emacs,
105all terminals should be restored to their previous states.
daf01701 106
7b00d185
KL
107This is work in progress, and probably full of bugs. You should
108always run emacs from gdb, so that you'll have a live instance to
2246281f 109debug if something goes wrong. Please send me your bug reports.
04c3243c 110
bacb6689
KL
111I think the best way to use the new Emacs is to have it running inside
112a disconnected GNU screen session, and always use emacsclient for
113normal work. This way not a single keystroke of your work will be
114lost if the display device that you are using crashes, or the network
115connection times out, or whatever. As long as the server that runs
116your Emacs remains up, all your buffers remain exactly as they were
117before the crash, and you can continue working as if nothing had
118happened. (I had an extremely unstable X server for some time while I
119was developing these patches, and running Emacs this way has saved me
120a number of M-x recover-session invocations.)
121
122(I am thinking about introducing a --daemon option to get rid of the
123above screen dependency.)
124
7b00d185 125Problems:
6548cf00 126
7b00d185
KL
127 * Mac, Windows and DOS support is broken, probably doesn't
128 even compile -- this will be solved later.
129
d3c554a0 130 * Only tested on my GNU/Linux box, Solaris 8 and FreeBSD.
28d440ab
KL
131
132NEWS
133----
134
135For the NEWS file:
136
2246281f 137** Support for multiple terminal devices has been added.
6548cf00 138
2246281f
KL
139*** You can specify a terminal device (`tty' parameter) and a terminal
140 type (`tty-type' parameter) to `make-terminal-frame'.
6548cf00 141
2246281f
KL
142*** You can test for the presence of multiple terminal support by
143 testing for the `multi-tty' feature.
28d440ab 144
2246281f 145*** Emacsclient has been extended to support opening a new terminal
aaaf7fe1
KL
146 frame. Its behaviour has been changed to open a new Emacs frame by
147 default. Use the -c option to get the old behavior of opening
148 files in the currently selected Emacs frame.
e5299d8d 149
2246281f
KL
150*** A make-frame-on-tty function has been added to make it easier to
151 create frames on new terminals.
152
153*** New functions: frame-tty-name, frame-tty-type for accessing
154 terminal parameters, and delete-tty for closing the terminal
155 device.
156
157*** talk.el has been extended for multiple tty support.
158
159
160** Support for simultaneous graphical and terminal frames has been
161 added.
162
163*** The function `make-frame-on-display' now works during a terminal
164 session, and `make-frame-on-tty' works during a graphical session.
165
166*** The `window-system' variable has been made frame-local.
167
168*** The new `initial-window-system' variable contains the
169 `window-system' value for the first frame.
819b8f00 170
d448e982
KL
171THANKS
172------
173
174The following is an (incomplete) list of people who have contributed
175to the project by testing, bug reports, and suggestions. Thanks!
176
026ad6ba 177Robert J. Chassell <bob at rattlesnake dot com>
806c1866 178Romain Francoise <romain at orebokech dot com>
0c72d684 179Ami Fischman <ami at fischman dot org>
4edd8a5c 180Istvan Marko <mi-mtty ar kismala dot com>
0c72d684 181Dan Nicolaescu <dann at ics dot uci dot edu>
cd5355f9 182Gergely Nagy <algernon at debian dot org>
aaaf7fe1 183Mark Plaksin <happy at mcplaksin dot org>
026ad6ba 184Francisco Borges <borges at let dot rug dot nl>
d3c554a0 185Frank Ruell <stoerte at dreamwarrior dot net>
9002956f 186and many others.
0c72d684 187
d3c554a0
KL
188Richard Stallman was kind enough to review an earlier version of my
189patches.
d448e982 190
28d440ab
KL
191CHANGELOG
192---------
193
194See arch logs.
195
7b00d185
KL
196THINGS TO DO
197------------
4edd8a5c 198
54021676
KL
199** frame-creation-function was removed, which might be a bad idea.
200 Think up a compatible solution.
201
202** make-frame does not correctly handle extra parameters in its
203 argument:
204
205 (frame-parameter (make-frame (list (cons 'foobar 42))) 'foobar)
206 => nil
207
208 (This is likely an error in the CVS trunk.)
209
d3c554a0
KL
210** Fix set-input-mode for multi-tty. It's a truly horrible interface;
211 what if we'd blow it up into several separate functions (with a
212 compatibility definition)?
213
4388f101
KL
214** Emacs assumes that all terminal frames have the same locale
215 settings as Emacs itself. This may lead to bogus results in a
216 multi-locale setup. (E.g., while logging in from a remote client
217 with a different locale.)
218
cd5355f9
KL
219** The single-keyboard mode of MULTI_KBOARD is extremely confusing
220 sometimes; Emacs does not respond to stimuli from other keyboards.
221 At least a beep or a message would be important, if the single-mode
222 is still required to prevent interference. (Reported by Dan
026ad6ba
KL
223 Nicolaescu.) (Update: selecting a region with the mouse enables
224 single_kboard under X. This is very confusing.)
cd5355f9 225
2666355c 226** Change Lisp code not to (getenv "TERM"); use the `tty-type' frame
d3c554a0
KL
227 parameter or the frame-tty-type function instead. (M-x tags-search
228 "TERM" helps with this.) Update: Actually, all getenv invocations
229 should be checked for multi-tty compatibility, and an interface
230 must be implemented to get the remote client's environment.
2666355c
KL
231
232** The terminal customization files in term/*.el tend to change global
233 parameters, which may confuse Emacs with multiple displays. Change
234 them to tweak only frame-local settings, if possible.
235
01d81f75
KL
236** Dan Nicolaescu suggests that -nw should be added as an alias for -t
237 in emacsclient. Good idea. (Alas, implementing this is not
238 trivial, getopt_long does not seem to support two-letter ``short''
d3c554a0 239 options. Patches are welcome.) :-)
01d81f75
KL
240
241** Mark Plaksin suggests that emacsclient should accept the same
242 X-related command-line arguments as Emacs. Most of the X-related
243 argument-handling is done in Lisp, so this should be quite easy to
244 implement.
d448e982 245
cd5355f9
KL
246** Gergely Nagy suggests that C-x # should only kill the current
247 frame, not any other emacsclient frame that may have the same file
248 opened for editing. I think I agree with him.
249
d3c554a0
KL
250** Miles Bader suggests that C-x C-c on an emacsclient frame should
251 only close the frame, not exit the entire Emacs session.
252
0b0d3e0b 253** Make `struct display' accessible to Lisp programs. Accessor functions:
4ca927b4 254
0b0d3e0b 255 (displayp OBJECT): Returns t if OBJECT is a display.
7b00d185 256
4388f101
KL
257 (display-list): Returns list of currently active displays.
258
0b0d3e0b
KL
259 (selected-display): Returns the display object of the selected frame.
260
261 (frame-display FRAME): Returns the display object of FRAME.
262
263 (display-frames DISPLAY): Returns a list of frames on DISPLAY.
264
265 (display-type DISPLAY): Returns the type of DISPLAY, as a
266 symbol. (See `framep'.)
267
268 (display-device DISPLAY): Returns the name of the device that
269 DISPLAY uses, as a string. (E.g: "/dev/pts/16", or
270 ":0.0")
271
4388f101
KL
272 etc.
273
0b0d3e0b
KL
274 See next issue why this is necessary.
275
276** The following needs to be supported:
277
278 $ emacsclient -t
279 C-z
0b0d3e0b
KL
280 $ emacsclient -t
281 (This fails now.)
282
283 The cleanest way to solve this is to allow multiple displays on the
284 same terminal device; each new emacsclient process should create
285 its own display. As displays are currently identified by their
286 device names, this is not possible until struct display becomes
287 accessible as a Lisp-level object.
bacb6689
KL
288
289** Add an elaborate mechanism for display-local variables. (There are
290 already a few of these; search for `terminal-local' in the Elisp
291 manual.)
292
0b0d3e0b
KL
293** Very strange bug: visible-bell does not work on secondary
294 terminals in xterm and konsole. The screen does flicker a bit,
295 but it's so quick it isn't noticable.
296
297** Clean up the frame-local variable system. I think it's ugly and
298 error-prone. But maybe I just haven't yet fully understood it.
299
428a555e 300** Move baud_rate to struct display.
7b00d185 301
7b00d185
KL
302** Implement support for starting an interactive Emacs session without
303 an initial frame. (The user would connect to it and open frames
f70dd009 304 later, with emacsclient.)
7b00d185 305
3224dac1
KL
306** Fix Mac support (I can't do this myself). Note that the current
307 state of Mac-specific source files in the multi-tty tree are not
308 useful; before starting work on Mac support, revert to pristine,
309 pre-multi-tty versions.
7b00d185 310
3224dac1
KL
311** Fix W32 support (I can't do this myself). Note that the current
312 state of W32-specific source files in the multi-tty tree are not
313 useful; before starting work on W32 support, revert to pristine,
314 pre-multi-tty versions.
7b00d185 315
3224dac1
KL
316** Fix DOS support (I can't do this myself). Note that the current
317 state of DOS-specific source files in the multi-tty tree are not
318 useful; before starting work on DOS support, revert to pristine,
319 pre-multi-tty versions.
7b00d185
KL
320
321** Do a grep on XXX and ?? for more issues.
322
d3c554a0
KL
323** Understand Emacs's low-level input system (it's black magic) :-)
324 What exactly does interrupt_input do? I tried to disable it for
325 raw secondary tty support, but it does not seem to do anything
326 useful. (Update: Look again. X unconditionally enables this, maybe
327 that's why raw terminal support is broken again. I really do need
328 to understand input.)
7b00d185 329
2246281f
KL
330** Maybe standard-display-table should be display-local.
331
6548cf00
KL
332DIARY OF CHANGES
333----------------
334
335(ex-TODO items with explanations.)
28d440ab 336
114a8b8c 337-- Introduce a new struct for terminal devices.
28d440ab 338
daf01701 339 (Done, see struct tty_output. The list of members is not yet
28d440ab
KL
340 complete.)
341
28d440ab
KL
342-- Change the bootstrap procedure to initialize tty_list.
343
344 (Done, but needs review.)
345
28d440ab
KL
346-- Change make-terminal-frame to support specifying another tty.
347
348 (Done, new frame parameters: `tty' and `tty-type'.)
349
9628b887
KL
350-- Implement support for reading from multiple terminals.
351
352 (Done, read_avail_input tries to read from each terminal, until one
28d7d09f 353 succeeds. MULTI_KBOARD is not used. Secondary terminals don't send
6548cf00 354 SIGIO!)
9628b887 355
819b8f00
KL
356 (Update: They do, now.)
357
daf01701
KL
358 (Update2: After enabling X, they don't.)
359
9628b887 360-- other-frame should cycle through the frames on the `current'
114a8b8c 361 terminal only.
9628b887 362
6548cf00 363 (Done, by trivially modifiying next_frame and prev_frame.)
9628b887
KL
364
365-- Support different terminal sizes.
114a8b8c 366
9628b887
KL
367 (Done, no problem.)
368
369-- Make sure terminal resizes are handled gracefully. (Could be
370 problematic.)
371
6548cf00
KL
372 (Done. We don't get automatic SIGWINCH for additional ttys,
373 though.)
9628b887
KL
374
375-- Extend emacsclient to automatically open a new tty when it connects
376 to Emacs.
114a8b8c 377
9628b887
KL
378 (Done. It's an ugly hack, needs more work.)
379
52c2ee2a
KL
380-- Redisplay must refresh the topmost frame on *all* terminals, not
381 just the initial terminal.
114a8b8c 382
52c2ee2a 383 (Done, but introduced an ugly redisplay problems. Ugh.)
9628b887 384
6548cf00
KL
385-- Fix redisplay problems.
386
52c2ee2a
KL
387 (Done; it turned out that the entire Wcm structure must be moved
388 inside tty_output. Why didn't I catch this earlier?)
6548cf00
KL
389
390-- Provide a way for emacsclient to tell Emacs that the tty has been
391 resized.
392
393 (Done, simply forward the SIGWINCH signal.)
394
395-- Each keypress should automatically select the frame corresponding
396 to the terminal that it was coming from. This means that Emacs
397 must know from which terminal the last keyboard event came from.
6548cf00 398
52c2ee2a
KL
399 (Done, it was quite simple, the input event system already
400 supported multiple frames.)
6548cf00
KL
401
402-- Fix SIGIO issue with secondary terminals.
403
404 (Done, emacsclient signals Emacs after writing to the proxy pseudo
52c2ee2a
KL
405 terminal. Note that this means that multi-tty does not work with
406 raw ttys!)
28d440ab 407
0a125897
KL
408 (Update: This is bullshit. There is a read_input_waiting function,
409 extend that somehow.)
410
819b8f00
KL
411 (Update of update: The first update was not right either, extending
412 read_input_waiting was not necessary. Secondary ttys do seem to
413 send signals on input.)
414
daf01701
KL
415 (Update^3: Not any more.)
416
fca177d4
KL
417-- Make make-terminal-frame look up the `tty' and `tty-type' frame
418 parameters from the currently selected terminal before the global
419 default.
420
421 (Done.)
422
423-- Put all cached terminal escape sequences into struct tty_output.
424 Currently, they are still stored in global variables, so we don't
425 really support multiple terminal types.
426
52c2ee2a 427 (Done. It was not fun.)
fca177d4
KL
428
429-- Implement sane error handling after initialization. (Currently
6548cf00
KL
430 emacs exits if you specify a bad terminal type.) The helpful error
431 messages must still be provided when Emacs starts.
432
fca177d4
KL
433 (Done.)
434
435-- Implement terminal deletion, i.e., deleting local frames, closing
436 the tty device and restoring its previous state without exiting
437 Emacs.
9628b887 438
fca177d4
KL
439 (Done, but at the moment only called when an error happens during
440 initialization. There is a memory corruption error around this
daf01701 441 somewhere.) (Update: now it is fully enabled.)
fca177d4 442
8303ba32
KL
443-- Implement automatic deletion of terminals when the last frame on
444 that terminal is closed.
445
446 (Done.)
447
0a125897
KL
448-- Restore tty screen after closing the terminal.
449
450 (Done, we do the same as Emacs 21.2 for all terminals.)
451
452-- 'TERM=dumb src/emacs' does not restore the terminal state.
114a8b8c 453
0a125897 454 (Done.)
fca177d4 455
b2af72d2
KL
456-- C-g should work on secondary terminals.
457
458 (Done, but the binding is not configurable.)
459
460-- Deal with SIGHUP in Emacs and in emacsclient. (After this, the
461 server-frames may be removed from server.el.)
462
463 (Done, nothing to do. It seems that Emacs does not receive SIGHUP
daf01701 464 from secondary ttys, which is actually a good thing.) (Update: I
7b00d185 465 think it would be a bad idea to remove server-frames.)
b2af72d2 466
daf01701 467-- Change emacsclient/server.el to support the -t argument better,
b2af72d2
KL
468 i.e. automatically close the socket when the frame is closed.
469
470 (Seems to be working OK.)
471
16c290d8 472-- Fix mysterious memory corruption error with tty deletion. To
fca177d4
KL
473 trigger it, try the following shell command:
474
475 while true; do TERM=no-such-terminal-definition emacsclient -h; done
476
477 Emacs usually dumps core after a few dozen iterations. (The bug
3224dac1 478 seems to be related to the xfreeing or bzeroing of
9d9f1812
KL
479 tty_output.Wcm. Maybe there are outside references to struct Wcm?
480 Why were these vars collected into a struct before multi-tty
481 support?)
fca177d4 482
16c290d8
KL
483 (Done. Whew. It turned out that the problem had nothing to do
484 with hypothetical external references to Wcm, or any other
485 tty_output component; it was simply that delete_tty closed the
486 filehandles of secondary ttys twice, resulting in fclose doubly
3224dac1 487 freeing memory. Utterly trivial matter. I love the C's memory
16c290d8
KL
488 management, it puts hair on your chest.)
489
819b8f00 490-- Support raw secondary terminals. (Note that SIGIO works only on
3224dac1 491 the controlling terminal.) Hint: extend read_input_waiting for
819b8f00 492 multiple ttys and hopefully this will be fixed.
fca177d4 493
819b8f00
KL
494 (Done, it seems to have been working already for some time. It
495 seems F_SETOWN does work, after all. Not sure what made it fail
496 earlier, but it seems to be fixed (there were several changes
497 around request_sigio, maybe one of them did it).
3224dac1 498 read_input_waiting is only used in sys_select, don't change
daf01701 499 it.) (Update: After adding X support, it's broken again.)
d3c554a0 500 (Update^2: No it isn't.) :-)
c1c63edb 501
819b8f00 502-- Find out why does Emacs abort when it wants to close its
0a125897 503 controlling tty. Hint: chan_process[] array. Hey, maybe
16c290d8
KL
504 noninterrupt-IO would work, too? Update: no, there is no process
505 for stdin/out.
c33d2d42 506
819b8f00
KL
507 (Done. Added add/delete_keyboard_wait_descriptor to
508 term_init/delete_tty. The hint was right, in a way.)
6548cf00 509
819b8f00 510-- Issue with SIGIO: it needs to be disabled during redisplay. See if
3224dac1 511 fcntl kernel behaviour could be emulated by emacsclient.
0a125897 512
819b8f00 513 (Done. Simply disabled the SIGIO emulation hack in emacsclient.)
d3c554a0 514 (Update: it was added back.) (Update^2: and removed again.)
22de1e79 515
819b8f00 516-- server.el: There are issues with saving files in buffers of closed
16c290d8
KL
517 clients. Try editing a file with emacsclient -f, and (without
518 saving it) do a delete-frame. The frame is closed without
519 question, and a surprising confirmation prompt appears in another
520 frame.
521
819b8f00
KL
522 (Done. delete-frame now asks for confirmation if it still has
523 pending buffers, and modified buffers don't seem to be deleted.)
524
525-- emacsclient.el, server.el: Handle eval or file open errors when
daf01701 526 doing -t.
16c290d8 527
819b8f00 528 (Done.)
22de1e79 529
819b8f00
KL
530-- Make parts of struct tty_output accessible from Lisp. The device
531 name and the type is sufficient.
22de1e79 532
819b8f00
KL
533 (Done, see frame-tty-name and frame-tty-type.)
534
535-- Export delete_tty to the Lisp environment, for emacsclient.
22de1e79 536
819b8f00
KL
537 (Done, see delete-tty.)
538
daf01701
KL
539-- Get rid of the accessor macros in termchar.h, or define macros for
540 all members.
541
542 (Done.)
543
544-- Move device-specific parameters (like costs) commonly used by
545 device backends to a common, device-dependent structure.
546
547 (Done. See struct display_method in termhooks.h.)
548
549-- Fix X support.
550
551 (Done. Well, it seems to be working.)
552
553-- Allow simultaneous X and tty frames. (Handling input could be
554 tricky. Or maybe not.)
555
556 (Done. Allowed, that is. It is currently extremely unstable, to
557 the point of being unusable. The rif variable causes constant
558 core dumps. Handling input is indeed tricky.)
819b8f00 559
7b00d185 560-- Rewrite multi-tty input in terms of MULTI_KBOARD.
28d440ab 561
7b00d185
KL
562 (Done. In fact, there was no need to rewrite anything, I just
563 added a kboard member to tty_display_info, and initialized the
564 frame's kboard from there.)
819b8f00 565
fa971ac3
KL
566-- Fix rif issue with X-tty combo sessions. IMHO the best thing to do
567 is to get rid of that global variable (and use the value value in
568 display_method, which is guaranteed to be correct).
569
570 (Done, did exactly that. Core dumps during combo sessions became
571 much rarer. In fact, I have not yet met a single one.)
572
17086732
KL
573-- Add multi-tty support to talk.el.
574
575 (Done.)
576
428a555e
KL
577-- Clean up the source of emacsclient. It is a mess.
578
579 (Done, eliminated stupid proxy-pty kludge.)
580
581-- Fix faces on tty frames during X-tty combo sessions. There is an
582 init_frame_faces call in init_sys_modes, see if there is a problem
583 with it.
584
585 (Done, there was a stupid mistake in
586 Ftty_supports_face_attributes_p. Colors are broken, though.)
587
588-- C-x 5 2, C-x 5 o, C-x 5 0 on an emacsclient frame unexpectedly
589 exits emacsclient. This is a result of trying to be clever with
590 delete-frame-functions.
591
592 (Fixed, added delete-tty-after-functions, and changed server.el to
593 use it.)
594
595-- Something with (maybe) multi-keyboard support broke function keys
596 and arrows on ttys during X+tty combo sessions. Debug this.
597
598 (I can't reproduce it, maybe the terminal type was wrong.)
599
600-- Fix input from raw ttys (again).
601
602 (Now it seems to work all right.)
603
604-- During an X-tty combo session, a (message "Hello") from a tty frame
605 goes to the X frame. Fix this.
606
607 (Done. There was a safeguard against writing to the initial
608 terminal frame during bootstrap which prevented echo_area_display
609 from working correctly on a tty frame during a combo session.)
610
114a8b8c 611-- If there are no frames on its controlling terminal, Emacs should
d3c554a0 612 exit if the user presses C-c there.
114a8b8c
KL
613
614 (Done, as far as possible. See the SIGTERM comment in
615 interrupt_signal on why this seems to be impossible to solve this
616 in general.)
617
618-- During an X session, Emacs seems to read from stdin. Also, Emacs
619 fails to start without a controlling tty.
620
621 (Fixed by replacing the troublesome termcap display with a dummy
622 bootstrap display during bootstrap.
623
624-- Do tty output through struct display, like graphical display
625 backends.
626
627 (Done.)
628
629-- Define an output_initial value for output_method for the initial
630 frame that is dumped with Emacs. Checking for this frame (e.g. in
631 cmd_error_internal) is ugly.
632
633 (Done, broking interactive temacs.)
634
635-- The command `emacsclient -t -e '(delete-frame)'' fails to exit.
636
637 (Fixed.)
638
4ca927b4
KL
639-- frame-creation-function should always create a frame that is on the
640 same display as the selected frame. Maybe frame-creation-function
641 should simply be removed and make-frame changed to do the right
642 thing.
643
644 (Done, with a nice hack. frame-creation-function is now frame-local.)
645
646-- Fix C-g on raw ttys.
647
648 (Done. I disabled the interrupt/quit keys on all secondary
649 terminals, so Emacs sees C-g as normal input. This looks like an
650 overkill, because emacsclient has extra code to pass SIGINT to
651 Emacs, so C-g should remain the interrupt/quit key on emacsclient
652 frames. See the next entry why implementing this distinction would
653 be a bad idea.)
654
655-- Make sure C-g goes to the right frame with ttys. This is hard, as
656 SIGINT doesn't have a tty parameter. :-(
657
658 (Done, the previous change fixes this as a pleasant side effect.)
659
c0707982
KL
660-- I have seen a case when Emacs with multiple ttys fell into a loop
661 eating 100% of CPU time. Strace showed this loop:
662
663 getpid() = 30284
664 kill(30284, SIGIO) = 0
665 --- SIGIO (I/O possible) @ 0 (0) ---
666 ioctl(6, FIONREAD, [0]) = -1 EIO (Input/output error)
667 ioctl(5, FIONREAD, [0]) = -1 EIO (Input/output error)
668 ioctl(0, FIONREAD, [0]) = 0
669 sigreturn() = ? (mask now [])
670 gettimeofday({1072842297, 747760}, NULL) = 0
671 gettimeofday({1072842297, 747806}, NULL) = 0
672 select(9, [0 3 5 6], NULL, NULL, {0, 0}) = 2 (in [5 6], left {0, 0})
673 select(9, [0 3 5 6], NULL, NULL, {0, 0}) = 2 (in [5 6], left {0, 0})
674 gettimeofday({1072842297, 748245}, NULL) = 0
675
676 I have seen something similar with a single X frame, but have not
677 been able to reproduce it for debugging.
678
679 Update: This may have been caused by checking for nread != 0
680 instead of nread > 0 after calling read_socket_hook in
681 read_avail_input.
682
683 (Fixed. This was caused by unconditionally including stdin in
684 input_wait_mask in init_process. The select call in
685 wait_reading_process_input always returned immediately, indicating
686 that there is pending input from stdin, which nobody read.
687
688 Note that the above strace output seems to be an unrelated but
689 similar bug. I think that is now fixed.)
4ca927b4 690
2246281f
KL
691-- Exiting Emacs while there are emacsclient frames doesn't restore the
692 ttys to their default states.
693
694 (This seems to be fixed by some previous change.)
695
696-- Allow opening an X session after -nw.
697
698 (Done.)
699
d448e982
KL
700-- Fix color handling during tty+X combo sessions. (It seems that tty
701 sessions automatically convert the face colors to terminal colors
702 when the face is loaded. This conversion must happen instead on
703 the fly in write_glyphs, which might be problematic, as color
704 approximation is currently done in lisp (term/tty-colors.el).)
705 (Update: hm, colors seem to work fine if I start emacs with -nw and
706 then create an X frame. Maybe it's just a small buglet somewhere.)
707
708 (Seems to be fixed. The problem was in startup.el, it did not
709 initialize tty colors when the initial window system was
710 graphical.)
2246281f 711
2441679b
KL
712-- emacs -nw --eval '(y-or-n-p "Foobar")' segfaults. (Reported by
713 Romain Francoise)
714
715 (Fixed, there was a keyboard initialization problem.)
716
3bbdbec9
KL
717-- Fix interactive use of temacs. There are face-related SEGVs, most
718 likely because of changes in realize_default_face, realize_face.
719
720 (Fixed.)
721
bacb6689
KL
722-- Don't exit Emacs when the last X connection fails during a
723 multi-display session.
724
725 (Fixed.)
726
0c72d684
KL
727-- Dan Nicolaescu noticed that starting emacsclient on the same
728 terminal device that is the controlling tty of the Emacs process
729 gives unexpected results.
730
731 (Fixed.)
732
4edd8a5c
KL
733-- Istvan Marko reported that Emacs hang on ttys if it was started
734 from a shell script.
735
736 (Fixed. There was a bug in the multi-tty version of
737 narrow_foreground_group. tcsetpgrp blocks if it is called from a
738 process that is not in the same process group as the tty.)
739
2fc0cf2a
KL
740-- emacsclient -t from an Emacs term buffer does not work, complains
741 about face problems. This can even lock up Emacs (if the recursive
742 frame sets single_kboard). Update: the face problems are caused by
743 bugs in term.el, not in multi-tty. The lockup is caused by
d3c554a0 744 single_kboard mode, and is not easily resolvable. The best thing to
2fc0cf2a
KL
745 do is to simply refuse to create a tty frame of type `eterm'.
746
747 (Fixed, changed emacsclient to check for TERM=eterm. The face
748 complaints seem to be caused by bugs in term.el; they are not
749 related to multi-tty.)
750
0b0d3e0b
KL
751-- Find out the best way to support suspending Emacs with multiple
752 ttys. My guess: disable it on the controlling tty, but from other
753 ttys pass it on to emacsclient somehow. (It is (I hope) trivial to
754 extend emacsclient to handle suspend/resume. A `kill -STOP' almost
755 works right now.)
756
757 (Done. I needed to play with signal handling and the server
758 protocol a bit to make emacsclient behave as a normal UNIX program
759 wrt foreground/background process groups.)
760
eb1f46c9
KL
761-- There is a flicker during the startup of `emacs -nw'; it's as if
762 the terminal is initialized, reset and then initialialized again.
763 Debug this. (Hint: narrow_foreground_group is called twice during
764 startup.)
765
766 (This is gone.)
767
026ad6ba
KL
768-- Robert Chassell has found serious copy-paste bugs with the
769 multi-tty branch. There seem to be redisplay bugs while copying
770 from X to a terminal frame. Copying accented characters do not
771 work for me.
772
773 (Patch-124 should fix this, by changing the interprogram-*-function
774 variables to be frame-local, as suggested by Mark Plaksin
775 (thanks!). I think that the redisplay bugs are in fact not bugs,
776 but delays caused by single_kboard --> perhaps MULTI_KBOARD should
777 be removed.)
778
779
0b0d3e0b 780
28d440ab 781;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d