1 -*- coding: utf-8; mode: text; -*-
5 The goal of this branch is to implement support for opening multiple,
6 different tty devices and simultaneous X and tty frames from a single
10 Emacs is notoriously slow at startup, so most people use another
11 editor or emacsclient for quick editing jobs from the console.
12 Unfortunately, emacsclient was very awkward to use, because it did not
13 support opening a new Emacs frame on the current virtual console.
14 Now, with multi-tty support, it can do that. (Emacsclient starts up
17 Some Gnus users (including me) run Gnus in an X frame in its own Emacs
18 instance, which they typically leave running for weeks. It would be
19 nice if they could connect to this instance from a remote ssh session
20 and check their messages without opening a remote X frame or resorting
26 I'm Károly Lőrentey. My address: lorentey@elte.hu.
28 Comments, bug reports, suggestions and patches are welcome; send them
29 to multi-tty@lists.fnord.hu.
34 The multi-tty mailing list (discussion & bug reports):
36 Address: multi-tty@lists.fnord.hu
37 Signup: http://lists.fnord.hu/mailman/listinfo/multi-tty
38 Archive: http://news.gmane.org/gmane.emacs.multi-tty/
40 Commit notifications (read-only):
42 Address: multi-tty-commits@lists.fnord.hu
43 Signup: http://lists.fnord.hu/mailman/listinfo/multi-tty-commits
49 The branch is now very stable and almost full-featured. All of the
50 major problems have been fixed, only a few minor issues remain. (It
51 still needs to be ported to Windows/Mac/DOS, though.) Both multiple
52 tty device support and simultaneous X and tty frame support works
53 fine. Emacsclient has been extended to support opening new tty and X
54 frames. It has been changed open new Emacs frames by default.
56 The multi-tty branch has been scheduled for inclusion in the next
57 major release of Emacs (version 22). I expect the merge into the
58 development trunk to occur sometime during next year (2005), after the
59 merge of the Unicode branch.
61 Please let me know if you find any bugs in this branch.
65 * Mac, Windows and DOS support is broken, probably doesn't
66 even compile -- this will be solved later.
68 * Tested on GNU/Linux, Solaris 8, FreeBSD and OpenBSD.
74 The branch uses GNU Arch (http://www.gnuarch.org) for version control.
76 Retrieving the latest version of the branch:
78 tla register-archive lorentey@elte.hu--2004 http://lorentey.hu/arch/2004/
79 tla get lorentey@elte.hu--2004/emacs--multi-tty <directory>
81 This incantation uses my private archive mirror that is hosted on a
82 relatively low-bandwidth site; if you are outside Hungary, you will
83 probably want to you use the Arch supermirror instead:
85 tla register-archive lorentey@elte.hu--2004 http://mirrors.gnuarch.org/lorentey@elte.hu--2004/
86 tla get lorentey@elte.hu--2004/emacs--multi-tty <directory>
88 (I use a recent tla development snapshot, but any of the released
89 versions of arch will do fine, I think.) My GPG key id is 0FB27A3F;
90 it is available from hkp://wwwkeys.eu.pgp.net/, or my homepage at
91 http://lorentey.hu/rolam/gpg.html)
93 To update your source tree to the latest revision after the first
94 checkout, simply use the following command:
96 tla replay lorentey@elte.hu--2004/emacs--multi-tty--0
98 If you are interested, you can find more information about Arch on
99 http://wiki.gnuarch.org/. It's a wonderful source control system, I
102 If you don't have tla, the branch has a homepage from which you can
103 download conventional patches against Emacs CVS HEAD:
105 http://lorentey.hu/project/emacs.html
111 The multi-tty branch is compiled the same way as Emacs itself:
113 ./configure <your favourite options>
120 To try out the multi-tty branch start up the Emacs server with the
126 and then (from a shell prompt on another terminal) start emacsclient
128 emacsclient -t /optional/file/names... (for a tty frame)
129 emacsclient /optional/file/names... (for an X frame)
131 (Make sure both emacs and emacsclient are multi-tty versions.)
132 You'll hopefully have two fully working, independent frames on
133 separate terminals. The new frame is closed automatically when you
134 finish editing the specified files (C-x #), but delete-frame (C-x 5 0)
135 also works. Of course, you can create frames on more than two tty
138 Creating new frames on the same tty with C-x 5 2 works, and they
139 behave the same way as in previous Emacs versions. If you exit emacs,
140 all terminals should be restored to their previous states.
142 This is work in progress, and probably full of bugs. You should
143 always run emacs from gdb, so that you'll have a live instance to
144 debug if something goes wrong. Please send me your bug reports.
149 I think the best way to use the new Emacs is to have it running inside
150 a disconnected GNU screen session, and always use emacsclient for
151 normal work. One advantage of this is that not a single keystroke of
152 your work will be lost if the display device that you are using
153 crashes, or the network connection times out, or whatever. (I had an
154 extremely unstable X server for some time while I was developing these
155 patches, and running Emacs this way has saved me a number of M-x
156 recover-session invocations.)
158 I use the following two bash functions to handle my Emacs sessions:
160 ,----[ ~/.bash_profile
161 | # Usage: preload-emacs <name> [<waitp>]
163 | # Preloads the Emacs instance called NAME in a detached screen
164 | # session. Does nothing if the instance is already running. If WAITP
165 | # is non-empty, the function waits until the server starts up and
166 | # creates its socket; otherwise it returns immediately.
167 | function preload-emacs {
170 | local screendir="/var/run/screen/S-$USER"
171 | local serverdir="/tmp/emacs$UID"
172 | local emacs=emacs # Or wherever you installed your multi-tty Emacs
174 | if [ -z "$name" ]; then
175 | echo "Usage: preload-emacs <name> [<waitp>]" >&2
179 | if [ ! -e "$screendir"/*."$name" ]; then
180 | if [ -e "$serverdir/$name" ]; then
181 | # Delete leftover socket (for the wait option)
182 | rm "$serverdir/$name"
184 | screen -dmS "$name" "$emacs" -nw --eval "(setq server-name \"$name\")" -f server-start
186 | if [ ! -z "$waitp" ]; then
187 | while [ ! -e "$serverdir/$name" ]; do sleep 0.1; done
192 | # Usage: connect-emacs <name> <args>...
194 | # Connects to the Emacs instance called NAME. Starts up the instance
195 | # if it is not already running. The rest of the arguments are passed
197 | function connect-emacs {
201 | if [ -z "$name" ]; then
202 | echo "Usage: connect-emacs <name> <args>..." >&2
204 | preload-emacs "$name" wait
205 | emacsclient -s "$name" "$@"
208 | export -f preload-emacs connect-emacs
210 | # Preload editor and gnus sessions for speedy initial connects.
211 | preload-emacs editor
216 | alias gnus="connect-emacs gnus"
217 | alias edit="connect-emacs editor"
218 | alias et="connect-emacs editor -t"
226 For the NEWS file: (Needs work)
228 ** Support for multiple terminal devices has been added.
230 *** You can specify a terminal device (`tty' parameter) and a terminal
231 type (`tty-type' parameter) to `make-terminal-frame'.
233 *** You can test for the presence of multiple terminal support by
234 testing for the `multi-tty' feature.
236 *** Emacsclient has been extended to support opening a new terminal
237 frame. Its behaviour has been changed to open a new Emacs frame by
238 default. Use the -c option to get the old behavior of opening
239 files in the currently selected Emacs frame.
241 *** A make-frame-on-tty function has been added to make it easier to
242 create frames on new terminals.
244 *** New functions: frame-tty-name, frame-tty-type for accessing
245 terminal parameters, and delete-tty for closing the terminal
248 *** talk.el has been extended for multiple tty support.
251 ** Support for simultaneous graphical and terminal frames has been
254 *** The function `make-frame-on-display' now works during a terminal
255 session, and `make-frame-on-tty' works during a graphical session.
257 *** The `window-system' variable has been made frame-local.
259 *** The new `initial-window-system' variable contains the
260 `window-system' value for the first frame.
265 The following is an (incomplete) list of people who have contributed
266 to the project by testing, submitting patches, bug reports, and
269 ARISAWA Akihiro <ari at mbf dot ocn dot ne dot jp>
270 Han Boetes <han at mijncomputer dot nl>
271 Robert J. Chassell <bob at rattlesnake dot com>
272 Romain Francoise <romain at orebokech dot com>
273 Ami Fischman <ami at fischman dot org>
274 Friedrich Delgado Friedrichs <friedel at nomaden dot org>
275 IRIE Tetsuya <irie at t dot email dot ne dot jp>
276 Yoshiaki Kasahara <kasahara at nc dot kyushu-u dot ac dot jp>
277 Jurej Kubelka <Juraj dot Kubelka at email dot cz>
278 David Lichteblau <david at lichteblau dot com>
279 Istvan Marko <mi-mtty at kismala dot com>
280 Ted Morse <morse at ciholas dot com>
281 Dan Nicolaescu <dann at ics dot uci dot edu>
282 Gergely Nagy <algernon at debian dot org>
283 Mark Plaksin <happy at mcplaksin dot org>
284 Francisco Borges <borges at let dot rug dot nl>
285 Frank Ruell <stoerte at dreamwarrior dot net>
286 Dan Waber <dwaber at logolalia dot com>
289 Richard Stallman was kind enough to review an earlier version of my
300 ** Hunt down display-related functions in frame.el and extend them all
301 to accept display ids.
303 ** Have a look at fatal_error_hook.
305 ** Check if we got term-setup-hook right.
307 ** make-frame does not correctly handle extra parameters in its
310 (frame-parameter (make-frame (list (cons 'foobar 42))) 'foobar)
313 (This is likely an error in the CVS trunk.)
315 ** Fix set-input-mode for multi-tty. It's a truly horrible interface;
316 what if we'd blow it up into several separate functions (with a
317 compatibility definition)?
319 ** Lisp-level stuff that needs to be updated for multi-tty:
321 - normal-erase-is-backspace-mode (simple.el) (rep. by Dan Waber)
324 ** The single-keyboard mode of MULTI_KBOARD is extremely confusing
325 sometimes; Emacs does not respond to stimuli from other keyboards.
326 At least a beep or a message would be important, if the single-mode
327 is still required to prevent interference. (Reported by Dan
328 Nicolaescu.) (Update: selecting a region with the mouse enables
329 single_kboard under X. This is very confusing.) Update:
330 After discussions with Richard, this will be resolved by having
331 locked displays warn the user to wait, and introducing a complex
332 protocol to remotely bail out of single-kboard mode by pressing C-g.
334 ** The terminal customization files in term/*.el tend to change global
335 parameters, which may confuse Emacs with multiple displays. Change
336 them to tweak only frame-local settings, if possible.
338 ** Dan Nicolaescu suggests that -nw should be added as an alias for -t
339 in emacsclient. Good idea. (Alas, implementing this is not
340 trivial, getopt_long does not seem to support two-letter ``short''
341 options. Patches are welcome.) :-)
343 ** Mark Plaksin suggests that emacsclient should accept the same
344 X-related command-line arguments as Emacs. Most of the X-related
345 argument-handling is done in Lisp, so this should be quite easy to
348 ** Gergely Nagy suggests that C-x # should only kill the current
349 frame, not any other emacsclient frame that may have the same file
350 opened for editing. I think I agree with him.
352 ** Miles Bader suggests that C-x C-c on an emacsclient frame should
353 only close the frame, not exit the entire Emacs session. Update:
354 see above for a function that does this. Maybe this should be the
357 ** Very strange bug: visible-bell does not work on secondary
358 terminals in xterm and konsole. The screen does flicker a bit,
359 but it's so quick it isn't noticable.
361 ** Clean up the frame-local variable system. I think it's ugly and
362 error-prone. But maybe I just haven't yet fully understood it.
364 ** Move baud_rate to struct display.
366 ** Implement support for starting an interactive Emacs session without
367 an initial frame. (The user would connect to it and open frames
368 later, with emacsclient.)
370 ** Fix Mac support (I can't do this entirely myself). Note that the
371 current state of Mac-specific source files in the multi-tty tree
372 are not useful; before starting work on Mac support, revert to
373 pristine, pre-multi-tty versions.
375 ** Fix W32 support (I can't do this entirely myself). Note that the
376 current state of W32-specific source files in the multi-tty tree
377 are not useful; before starting work on W32 support, revert to
378 pristine, pre-multi-tty versions.
380 ** Fix DOS support (I can't do this entirely myself). Note that the
381 current state of DOS-specific source files in the multi-tty tree
382 are not useful; before starting work on DOS support, revert to
383 pristine, pre-multi-tty versions.
385 ** Do a grep on XXX and ?? for more issues.
387 ** Understand Emacs's low-level input system (it's black magic) :-)
388 What exactly does interrupt_input do? I tried to disable it for
389 raw secondary tty support, but it does not seem to do anything
390 useful. (Update: Look again. X unconditionally enables this, maybe
391 that's why raw terminal support is broken again. I really do need
392 to understand input.)
394 ** Maybe standard-display-table should be display-local.
399 (ex-TODO items with explanations.)
401 -- Introduce a new struct for terminal devices.
403 (Done, see struct tty_output. The list of members is not yet
406 -- Change the bootstrap procedure to initialize tty_list.
408 (Done, but needs review.)
410 -- Change make-terminal-frame to support specifying another tty.
412 (Done, new frame parameters: `tty' and `tty-type'.)
414 -- Implement support for reading from multiple terminals.
416 (Done, read_avail_input tries to read from each terminal, until one
417 succeeds. MULTI_KBOARD is not used. Secondary terminals don't send
420 (Update: They do, now.)
422 (Update2: After enabling X, they don't.)
424 -- other-frame should cycle through the frames on the `current'
427 (Done, by trivially modifiying next_frame and prev_frame.)
429 -- Support different terminal sizes.
433 -- Make sure terminal resizes are handled gracefully. (Could be
436 (Done. We don't get automatic SIGWINCH for additional ttys,
439 -- Extend emacsclient to automatically open a new tty when it connects
442 (Done. It's an ugly hack, needs more work.)
444 -- Redisplay must refresh the topmost frame on *all* terminals, not
445 just the initial terminal.
447 (Done, but introduced an ugly redisplay problems. Ugh.)
449 -- Fix redisplay problems.
451 (Done; it turned out that the entire Wcm structure must be moved
452 inside tty_output. Why didn't I catch this earlier?)
454 -- Provide a way for emacsclient to tell Emacs that the tty has been
457 (Done, simply forward the SIGWINCH signal.)
459 -- Each keypress should automatically select the frame corresponding
460 to the terminal that it was coming from. This means that Emacs
461 must know from which terminal the last keyboard event came from.
463 (Done, it was quite simple, the input event system already
464 supported multiple frames.)
466 -- Fix SIGIO issue with secondary terminals.
468 (Done, emacsclient signals Emacs after writing to the proxy pseudo
469 terminal. Note that this means that multi-tty does not work with
472 (Update: This is bullshit. There is a read_input_waiting function,
473 extend that somehow.)
475 (Update of update: The first update was not right either, extending
476 read_input_waiting was not necessary. Secondary ttys do seem to
477 send signals on input.)
479 (Update^3: Not any more.)
481 -- Make make-terminal-frame look up the `tty' and `tty-type' frame
482 parameters from the currently selected terminal before the global
487 -- Put all cached terminal escape sequences into struct tty_output.
488 Currently, they are still stored in global variables, so we don't
489 really support multiple terminal types.
491 (Done. It was not fun.)
493 -- Implement sane error handling after initialization. (Currently
494 emacs exits if you specify a bad terminal type.) The helpful error
495 messages must still be provided when Emacs starts.
499 -- Implement terminal deletion, i.e., deleting local frames, closing
500 the tty device and restoring its previous state without exiting
503 (Done, but at the moment only called when an error happens during
504 initialization. There is a memory corruption error around this
505 somewhere.) (Update: now it is fully enabled.)
507 -- Implement automatic deletion of terminals when the last frame on
508 that terminal is closed.
512 -- Restore tty screen after closing the terminal.
514 (Done, we do the same as Emacs 21.2 for all terminals.)
516 -- 'TERM=dumb src/emacs' does not restore the terminal state.
520 -- C-g should work on secondary terminals.
522 (Done, but the binding is not configurable.)
524 -- Deal with SIGHUP in Emacs and in emacsclient. (After this, the
525 server-frames may be removed from server.el.)
527 (Done, nothing to do. It seems that Emacs does not receive SIGHUP
528 from secondary ttys, which is actually a good thing.) (Update: I
529 think it would be a bad idea to remove server-frames.)
531 -- Change emacsclient/server.el to support the -t argument better,
532 i.e. automatically close the socket when the frame is closed.
534 (Seems to be working OK.)
536 -- Fix mysterious memory corruption error with tty deletion. To
537 trigger it, try the following shell command:
539 while true; do TERM=no-such-terminal-definition emacsclient -h; done
541 Emacs usually dumps core after a few dozen iterations. (The bug
542 seems to be related to the xfreeing or bzeroing of
543 tty_output.Wcm. Maybe there are outside references to struct Wcm?
544 Why were these vars collected into a struct before multi-tty
547 (Done. Whew. It turned out that the problem had nothing to do
548 with hypothetical external references to Wcm, or any other
549 tty_output component; it was simply that delete_tty closed the
550 filehandles of secondary ttys twice, resulting in fclose doubly
551 freeing memory. Utterly trivial matter. I love the C's memory
552 management, it puts hair on your chest.)
554 -- Support raw secondary terminals. (Note that SIGIO works only on
555 the controlling terminal.) Hint: extend read_input_waiting for
556 multiple ttys and hopefully this will be fixed.
558 (Done, it seems to have been working already for some time. It
559 seems F_SETOWN does work, after all. Not sure what made it fail
560 earlier, but it seems to be fixed (there were several changes
561 around request_sigio, maybe one of them did it).
562 read_input_waiting is only used in sys_select, don't change
563 it.) (Update: After adding X support, it's broken again.)
564 (Update^2: No it isn't.) :-)
566 -- Find out why does Emacs abort when it wants to close its
567 controlling tty. Hint: chan_process[] array. Hey, maybe
568 noninterrupt-IO would work, too? Update: no, there is no process
571 (Done. Added add/delete_keyboard_wait_descriptor to
572 term_init/delete_tty. The hint was right, in a way.)
574 -- Issue with SIGIO: it needs to be disabled during redisplay. See if
575 fcntl kernel behaviour could be emulated by emacsclient.
577 (Done. Simply disabled the SIGIO emulation hack in emacsclient.)
578 (Update: it was added back.) (Update^2: and removed again.)
580 -- server.el: There are issues with saving files in buffers of closed
581 clients. Try editing a file with emacsclient -f, and (without
582 saving it) do a delete-frame. The frame is closed without
583 question, and a surprising confirmation prompt appears in another
586 (Done. delete-frame now asks for confirmation if it still has
587 pending buffers, and modified buffers don't seem to be deleted.)
589 -- emacsclient.el, server.el: Handle eval or file open errors when
594 -- Make parts of struct tty_output accessible from Lisp. The device
595 name and the type is sufficient.
597 (Done, see frame-tty-name and frame-tty-type.)
599 -- Export delete_tty to the Lisp environment, for emacsclient.
601 (Done, see delete-tty.)
603 -- Get rid of the accessor macros in termchar.h, or define macros for
608 -- Move device-specific parameters (like costs) commonly used by
609 device backends to a common, device-dependent structure.
611 (Done. See struct display_method in termhooks.h.)
615 (Done. Well, it seems to be working.)
617 -- Allow simultaneous X and tty frames. (Handling input could be
618 tricky. Or maybe not.)
620 (Done. Allowed, that is. It is currently extremely unstable, to
621 the point of being unusable. The rif variable causes constant
622 core dumps. Handling input is indeed tricky.)
624 -- Rewrite multi-tty input in terms of MULTI_KBOARD.
626 (Done. In fact, there was no need to rewrite anything, I just
627 added a kboard member to tty_display_info, and initialized the
628 frame's kboard from there.)
630 -- Fix rif issue with X-tty combo sessions. IMHO the best thing to do
631 is to get rid of that global variable (and use the value value in
632 display_method, which is guaranteed to be correct).
634 (Done, did exactly that. Core dumps during combo sessions became
635 much rarer. In fact, I have not yet met a single one.)
637 -- Add multi-tty support to talk.el.
641 -- Clean up the source of emacsclient. It is a mess.
643 (Done, eliminated stupid proxy-pty kludge.)
645 -- Fix faces on tty frames during X-tty combo sessions. There is an
646 init_frame_faces call in init_sys_modes, see if there is a problem
649 (Done, there was a stupid mistake in
650 Ftty_supports_face_attributes_p. Colors are broken, though.)
652 -- C-x 5 2, C-x 5 o, C-x 5 0 on an emacsclient frame unexpectedly
653 exits emacsclient. This is a result of trying to be clever with
654 delete-frame-functions.
656 (Fixed, added delete-tty-after-functions, and changed server.el to
659 -- Something with (maybe) multi-keyboard support broke function keys
660 and arrows on ttys during X+tty combo sessions. Debug this.
662 (I can't reproduce it, maybe the terminal type was wrong.)
664 -- Fix input from raw ttys (again).
666 (Now it seems to work all right.)
668 -- During an X-tty combo session, a (message "Hello") from a tty frame
669 goes to the X frame. Fix this.
671 (Done. There was a safeguard against writing to the initial
672 terminal frame during bootstrap which prevented echo_area_display
673 from working correctly on a tty frame during a combo session.)
675 -- If there are no frames on its controlling terminal, Emacs should
676 exit if the user presses C-c there.
678 (Done, as far as possible. See the SIGTERM comment in
679 interrupt_signal on why this seems to be impossible to solve this
682 -- During an X session, Emacs seems to read from stdin. Also, Emacs
683 fails to start without a controlling tty.
685 (Fixed by replacing the troublesome termcap display with a dummy
686 bootstrap display during bootstrap.
688 -- Do tty output through struct display, like graphical display
693 -- Define an output_initial value for output_method for the initial
694 frame that is dumped with Emacs. Checking for this frame (e.g. in
695 cmd_error_internal) is ugly.
697 (Done, broking interactive temacs.)
699 -- The command `emacsclient -t -e '(delete-frame)'' fails to exit.
703 -- frame-creation-function should always create a frame that is on the
704 same display as the selected frame. Maybe frame-creation-function
705 should simply be removed and make-frame changed to do the right
708 (Done, with a nice hack. frame-creation-function is now frame-local.)
710 -- Fix C-g on raw ttys.
712 (Done. I disabled the interrupt/quit keys on all secondary
713 terminals, so Emacs sees C-g as normal input. This looks like an
714 overkill, because emacsclient has extra code to pass SIGINT to
715 Emacs, so C-g should remain the interrupt/quit key on emacsclient
716 frames. See the next entry why implementing this distinction would
719 -- Make sure C-g goes to the right frame with ttys. This is hard, as
720 SIGINT doesn't have a tty parameter. :-(
722 (Done, the previous change fixes this as a pleasant side effect.)
724 -- I have seen a case when Emacs with multiple ttys fell into a loop
725 eating 100% of CPU time. Strace showed this loop:
728 kill(30284, SIGIO) = 0
729 --- SIGIO (I/O possible) @ 0 (0) ---
730 ioctl(6, FIONREAD, [0]) = -1 EIO (Input/output error)
731 ioctl(5, FIONREAD, [0]) = -1 EIO (Input/output error)
732 ioctl(0, FIONREAD, [0]) = 0
733 sigreturn() = ? (mask now [])
734 gettimeofday({1072842297, 747760}, NULL) = 0
735 gettimeofday({1072842297, 747806}, NULL) = 0
736 select(9, [0 3 5 6], NULL, NULL, {0, 0}) = 2 (in [5 6], left {0, 0})
737 select(9, [0 3 5 6], NULL, NULL, {0, 0}) = 2 (in [5 6], left {0, 0})
738 gettimeofday({1072842297, 748245}, NULL) = 0
740 I have seen something similar with a single X frame, but have not
741 been able to reproduce it for debugging.
743 Update: This may have been caused by checking for nread != 0
744 instead of nread > 0 after calling read_socket_hook in
747 (Fixed. This was caused by unconditionally including stdin in
748 input_wait_mask in init_process. The select call in
749 wait_reading_process_input always returned immediately, indicating
750 that there is pending input from stdin, which nobody read.
752 Note that the above strace output seems to be an unrelated but
753 similar bug. I think that is now fixed.)
755 -- Exiting Emacs while there are emacsclient frames doesn't restore the
756 ttys to their default states.
758 (This seems to be fixed by some previous change.)
760 -- Allow opening an X session after -nw.
764 -- Fix color handling during tty+X combo sessions. (It seems that tty
765 sessions automatically convert the face colors to terminal colors
766 when the face is loaded. This conversion must happen instead on
767 the fly in write_glyphs, which might be problematic, as color
768 approximation is currently done in lisp (term/tty-colors.el).)
769 (Update: hm, colors seem to work fine if I start emacs with -nw and
770 then create an X frame. Maybe it's just a small buglet somewhere.)
772 (Seems to be fixed. The problem was in startup.el, it did not
773 initialize tty colors when the initial window system was
776 -- emacs -nw --eval '(y-or-n-p "Foobar")' segfaults. (Reported by
779 (Fixed, there was a keyboard initialization problem.)
781 -- Fix interactive use of temacs. There are face-related SEGVs, most
782 likely because of changes in realize_default_face, realize_face.
786 -- Don't exit Emacs when the last X connection fails during a
787 multi-display session.
791 -- Dan Nicolaescu noticed that starting emacsclient on the same
792 terminal device that is the controlling tty of the Emacs process
793 gives unexpected results.
797 -- Istvan Marko reported that Emacs hang on ttys if it was started
800 (Fixed. There was a bug in the multi-tty version of
801 narrow_foreground_group. tcsetpgrp blocks if it is called from a
802 process that is not in the same process group as the tty.)
804 -- emacsclient -t from an Emacs term buffer does not work, complains
805 about face problems. This can even lock up Emacs (if the recursive
806 frame sets single_kboard). Update: the face problems are caused by
807 bugs in term.el, not in multi-tty. The lockup is caused by
808 single_kboard mode, and is not easily resolvable. The best thing to
809 do is to simply refuse to create a tty frame of type `eterm'.
811 (Fixed, changed emacsclient to check for TERM=eterm. The face
812 complaints seem to be caused by bugs in term.el; they are not
813 related to multi-tty.)
815 -- Find out the best way to support suspending Emacs with multiple
816 ttys. My guess: disable it on the controlling tty, but from other
817 ttys pass it on to emacsclient somehow. (It is (I hope) trivial to
818 extend emacsclient to handle suspend/resume. A `kill -STOP' almost
821 (Done. I needed to play with signal handling and the server
822 protocol a bit to make emacsclient behave as a normal UNIX program
823 wrt foreground/background process groups.)
825 -- There is a flicker during the startup of `emacs -nw'; it's as if
826 the terminal is initialized, reset and then initialialized again.
827 Debug this. (Hint: narrow_foreground_group is called twice during
832 -- Robert Chassell has found serious copy-paste bugs with the
833 multi-tty branch. There seem to be redisplay bugs while copying
834 from X to a terminal frame. Copying accented characters do not
837 (Patch-124 should fix this, by changing the interprogram-*-function
838 variables to be frame-local, as suggested by Mark Plaksin
839 (thanks!). I think that the redisplay bugs are in fact not bugs,
840 but delays caused by single_kboard --> perhaps MULTI_KBOARD should
843 -- frame-creation-function was removed, which might be a bad idea.
844 Think up a compatible solution.
846 (It was an internal interface that may be changed when necessary.)
848 -- Change Lisp code not to (getenv "TERM"); use the `tty-type' frame
849 parameter or the frame-tty-type function instead. (M-x tags-search
850 "TERM" helps with this.) Update: Actually, all getenv invocations
851 should be checked for multi-tty compatibility, and an interface
852 must be implemented to get the remote client's environment.
854 (Done. Only getenv calls in lisp/term/*.el were changed; other
855 calls should be mostly left as they are.)
857 -- Add an elaborate mechanism for display-local variables. (There are
858 already a few of these; search for `terminal-local' in the Elisp
861 (Not needed. Display-local variables could be emulated by
862 frame-local variables.)
864 -- Emacs assumes that all terminal frames have the same locale
865 settings as Emacs itself. This may lead to bogus results in a
866 multi-locale setup. (E.g., while logging in from a remote client
867 with a different locale.)
868 (Update after new bugreport by Friedrich Delgado Friedrichs:
869 (at least) the structs terminal_coding and keyboard_coding in
870 coding.c must be moved to struct display, and the Lisp interface
871 [set-]keyboard-coding-system must be adapted for the change.)
873 (Fixed. Emacs now uses the locale settings as seen by the
874 emacsclient process for server tty frames.)
877 -- Make `struct display' accessible to Lisp programs. Accessor functions:
879 (displayp OBJECT): Returns t if OBJECT is a display.
880 => Implemented as display-live-p.
882 (display-list): Returns list of currently active displays.
885 (selected-display): Returns the display object of the selected frame.
886 => Not strictly necessary, but implemented anyway.
888 (frame-display FRAME): Returns the display object of FRAME.
891 (display-frames DISPLAY): Returns a list of frames on DISPLAY.
892 => Already implemented, see frames-on-display-list.
894 (display-type DISPLAY): Returns the type of DISPLAY, as a
895 symbol. (See `framep'.)
896 => Implemented as display-live-p.
898 (display-device DISPLAY): Returns the name of the device that
899 DISPLAY uses, as a string. (E.g: "/dev/pts/16", or
901 => Implemented as display-name.
905 See next issue why this is necessary.
907 (Update: The consensus on emacs-devel seems to be to do this via
908 integer identifiers. That's fine by me.)
912 -- The following needs to be supported:
919 The cleanest way to solve this is to allow multiple displays on the
920 same terminal device; each new emacsclient process should create
921 its own display. As displays are currently identified by their
922 device names, this is not possible until struct display becomes
923 accessible as a Lisp-level object.
927 ;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d