From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.bugs Subject: bug#70519: 30.0.50; Device for Emacs terminal I/O Date: Mon, 22 Apr 2024 22:09:18 +0200 Message-ID: <871q6xkvm9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19222"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 70519@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 22 22:10:05 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ryzzH-0004qA-Uw for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Apr 2024 22:10:03 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ryzz4-0001xS-LV; Mon, 22 Apr 2024 16:09:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ryzz3-0001xI-JI for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2024 16:09:49 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ryzz3-0005PW-BF for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2024 16:09:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ryzzI-0002j1-Sk for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2024 16:10:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Helmut Eller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Apr 2024 20:10:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70519 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.171381659510392 (code B ref -1); Mon, 22 Apr 2024 20:10:04 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Apr 2024 20:09:55 +0000 Original-Received: from localhost ([127.0.0.1]:47650 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryzz7-0002hN-Rm for submit@debbugs.gnu.org; Mon, 22 Apr 2024 16:09:55 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:49018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryzz3-0002g1-BQ for submit@debbugs.gnu.org; Mon, 22 Apr 2024 16:09:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ryzyg-0001vm-Rn for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2024 16:09:27 -0400 Original-Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ryzyc-0005J5-Qj for bug-gnu-emacs@gnu.org; Mon, 22 Apr 2024 16:09:25 -0400 Original-Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-34a4772d5easo3874789f8f.0 for ; Mon, 22 Apr 2024 13:09:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713816561; x=1714421361; darn=gnu.org; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=cpScmhZTt7dXYpK9SnWqwKdiGWYpse6QjkUF7cDnNFs=; b=Mnpo7B4F407EYtl+af7+mVxjdJHtDZKrZ/yIowG1jFJ5OlJrKkcPxF4twXjkBJ3XJ1 sPLDOoxLkp53BHEkRSWleDCfCzNf/hZyh0lHNQbQgMPA6RJiTT8fisoX5L3O1QYOFPq0 oMUq9KfSNQNE0iXuHmXUNB7uyH7ApQLGprjOrVaHNbLtSi0fFdudcrqNHbzhkUVoP84P BzHQlL8jZRILsqHej6DgBkE29fKi+NfAIOG/OXBKGwPzDPIIv64Gegw+DoK3WpmGmrdc nOtbMJlnS5WDocydQd9W9i20q5qqZiDP5OGfsX1uiAOCmmv0O/r8zvL3EIi7ogiHrwYk /s/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713816561; x=1714421361; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cpScmhZTt7dXYpK9SnWqwKdiGWYpse6QjkUF7cDnNFs=; b=ffS6eBCAFR2uQIGpHIAyHfwELcNr8w7iQ/eF/9RPWRWJ1x8oRuJjdfERCoEWKEJ+/r +chD7sBVJ4TnlG5MoM9E94Vdo/R5yzRgP9suuyIekFnLwR0MKqoSNuasgpk0jMAnxfFw TDXx7GU/+lAxse4oGEaopnw4ZZJyBLT9ALkjv+OPQTRqxqpVWxNZu7RW5WWFtK8RLfsP x4c5pTmAc6xZ5WSAcq0+Ynn0LODvSYWPkCFF7VusKsWLEbxV5DtB5Wff9/6ixrks38xd aBYRD2YTsyBowp4huJ/wbVVjpDsxFJc/6rjo+KMhsQTr6lAjmp1SNJyPiyGaentC8RSk KNjQ== X-Gm-Message-State: AOJu0YxIrVMJwKHdOicyo64YwvGhaGsbY+V2kWBFfarPJApOwgovTqyL 506IbaqUWN90pg8rnQhSrt6q16O6fkWqoyKijQ/m+R4I/L9J5h+RPXM83Q== X-Google-Smtp-Source: AGHT+IEcBQPRrOX1bX25fkFm6ZNE9A7ajaVNKlKzFSjKsBYda/lt6+lNKCzkn1TV9yZIsJge2LyJhw== X-Received: by 2002:a05:6000:188d:b0:341:c270:208f with SMTP id a13-20020a056000188d00b00341c270208fmr8999619wri.20.1713816560945; Mon, 22 Apr 2024 13:09:20 -0700 (PDT) Original-Received: from caladan ([89.107.106.118]) by smtp.gmail.com with ESMTPSA id e4-20020adff344000000b0034349225fbcsm12850608wrp.114.2024.04.22.13.09.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 13:09:19 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=eller.helmut@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283849 Archived-At: 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)