unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Helmut Eller <eller.helmut@gmail.com>
To: 70519@debbugs.gnu.org
Subject: bug#70519: 30.0.50; Device for Emacs terminal I/O
Date: Mon, 22 Apr 2024 22:09:18 +0200	[thread overview]
Message-ID: <871q6xkvm9.fsf@gmail.com> (raw)

I'd like to start Emacs under GDB, but so that Emacs doesn't use the
same terminal as GDB.  It seems that the --terminal command line switch
is there for exactly this use case.

However, it doesn't work.  Emacs parses the command line option and
replaces stdin and stdout with the correct device, but then in dispnew.c
it always calls init_tty with 0 as argument for the device name.  That
simply opens the controlling terminal, i.e. /dev/tty and that is usually
the same device as the one that GDB uses.

What would you think of the change below?

Helmut

diff --git a/src/dispnew.c b/src/dispnew.c
index 0f5063c047f..cc5b883c138 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6710,7 +6710,8 @@ init_display_interactive (void)
     init_foreground_group ();
 
     /* Open a display on the controlling tty. */
-    t = init_tty (0, terminal_type, 1); /* Errors are fatal. */
+    /* Errors are fatal. */
+    t = init_tty (ttyname (STDIN_FILENO), terminal_type, 1);
 
     /* Convert the initial frame to use the new display. */
     if (f->output_method != output_initial)






             reply	other threads:[~2024-04-22 20:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22 20:09 Helmut Eller [this message]
2024-04-23  5:32 ` bug#70519: 30.0.50; Device for Emacs terminal I/O Eli Zaretskii
2024-04-23  6:09   ` Helmut Eller
2024-05-04 10:34   ` Eli Zaretskii
2024-05-04 15:47     ` Helmut Eller
2024-05-04 16:19       ` Eli Zaretskii
2024-05-04 16:25         ` Helmut Eller
2024-05-04 17:03           ` Eli Zaretskii
2024-05-04 16:36         ` Paul Eggert
2024-05-04 17:19           ` Eli Zaretskii
2024-05-04 17:39             ` Paul Eggert
2024-05-04 18:19       ` Andreas Schwab
2024-05-04 18:27         ` Helmut Eller
2024-05-04 18:40           ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871q6xkvm9.fsf@gmail.com \
    --to=eller.helmut@gmail.com \
    --cc=70519@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).