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