From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#51426: 29.0.50; [PATCH] Should 'comint-term-environment' be connection-aware? Date: Tue, 26 Oct 2021 15:54:03 -0700 Message-ID: <69264ece-bb7f-4db1-f461-dacd33db2402@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1651D900213E791DBF272BE2" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32685"; mail-complaints-to="usenet@ciao.gmane.io" To: 51426@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 27 00:55:18 2021 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 1mfVLi-0008Ej-3n for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Oct 2021 00:55:18 +0200 Original-Received: from localhost ([::1]:50744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfVLg-0001GC-Un for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Oct 2021 18:55:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfVLT-0001G0-1X for bug-gnu-emacs@gnu.org; Tue, 26 Oct 2021 18:55:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36318) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfVLS-00024b-OW for bug-gnu-emacs@gnu.org; Tue, 26 Oct 2021 18:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mfVLS-0003JI-Av for bug-gnu-emacs@gnu.org; Tue, 26 Oct 2021 18:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Oct 2021 22:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51426 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163528885212627 (code B ref -1); Tue, 26 Oct 2021 22:55:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Oct 2021 22:54:12 +0000 Original-Received: from localhost ([127.0.0.1]:47858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfVKe-0003HW-0q for submit@debbugs.gnu.org; Tue, 26 Oct 2021 18:54:12 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:54132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfVKc-0003HO-Hi for submit@debbugs.gnu.org; Tue, 26 Oct 2021 18:54:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfVKc-0001Df-8o for bug-gnu-emacs@gnu.org; Tue, 26 Oct 2021 18:54:10 -0400 Original-Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:38707) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfVKZ-00020b-Ly for bug-gnu-emacs@gnu.org; Tue, 26 Oct 2021 18:54:09 -0400 Original-Received: by mail-pg1-x52c.google.com with SMTP id e65so998083pgc.5 for ; Tue, 26 Oct 2021 15:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:from:subject:message-id:date:mime-version:content-language; bh=XkxoL+MgEbAOXK8eknLLi23kUW1RLT2EysSnSEgobdA=; b=DDBONQseyxuJWBda4cfHNSJEQnkrN1TMbdGDNQa74TafQmDLA+4+l8q3FS0C/aIkGc poG2yYqdXITifYxn72aSxTQP2o68WJrKMDyZKLjOunc0Jim33o7LWSopWwzlOc5O6spz /2+KvwW8nW6QOF342Pz8z+cV6xNZJSvPwhRhh3JEsNV1fAv+3pqhWB+4cb7TYogfjLCt c2LnAflylohsqNAN9Hue83ajJlMqbsscMPx2KgUXL4DVe/yo6qINM4jj6ODZk9GtyPMb XuV28+1ezthLVZU85iBGXyN6Pqn98/bVR8SL0XXLZZKkL9HZVnpt0+l0zApjHgly7Dih rkUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:to:from:subject:message-id:date:mime-version :content-language; bh=XkxoL+MgEbAOXK8eknLLi23kUW1RLT2EysSnSEgobdA=; b=Z60garQI7HRvRoI+u/2sZ2PsL3JdtvLLKcOOpzuBXkmJpd5d89ZA+f41x4QJOTKKFG T0jCrnArox76lhd3kRNpttcW/ry+Mp8ttO6X9PVa+kHM1ja3mgnkILy1nEb3x6aS19zb IbmQX716mKG+XXUU2k9tB4y0KudM/dCJVULeWMlRKDdnrK4weIMIGQzU39HxGLoCRdoD dklQzu5/m5UIyR+zZ1jGpZ2rbonsSewilNQPYyeRKH18j4IN3/9VLYZtCii1EEvJPx+5 82E0GDMyUy4ZPo1yDSxjAj73HkOc2vVBTUEYoJhxs+9dNOkgF7duuF5s6aMxXmG/6QjX 6zPA== X-Gm-Message-State: AOAM5323HD7OJvZxz1acRHz8W/YWGujNxHsr0EuBqYjD106dmxLFtR/b qpM7GhwHmphY7VwmMXNPLsmO/uYUocs= X-Google-Smtp-Source: ABdhPJwIWowqF6uSUHNB75eIw6cKtJ0Htz6+lpqDYAjnHpUN4NMMpbgScVhstBysCENTqT2CXz5oFg== X-Received: by 2002:a63:89c6:: with SMTP id v189mr16652774pgd.308.1635288844891; Tue, 26 Oct 2021 15:54:04 -0700 (PDT) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id n19sm1816056pjq.40.2021.10.26.15.54.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Oct 2021 15:54:04 -0700 (PDT) X-Mozilla-News-Host: news://news.gmane.org:119 Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=jporterbugs@gmail.com; helo=mail-pg1-x52c.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" Xref: news.gmane.io gmane.emacs.bugs:218414 Archived-At: This is a multi-part message in MIME format. --------------1651D900213E791DBF272BE2 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit `comint-term-environment' consults `system-uses-terminfo' to determine how to set environment variables to indicate comint's terminal capabilities. However, `system-uses-terminfo' describes whether the host system running Emacs uses terminfo, not whether the remote system uses it. Similarly for `comint-terminfo-terminal'. If `comint-term-environment' were aware of connection-local variables, it would be possible to create a connection-local profile to configure this for remote hosts, e.g.: (connection-local-set-profile-variables 'remote-terminfo '((system-uses-terminfo . t) (comint-terminfo-terminal . "dumb-emacs-ansi"))) (connection-local-set-profiles '(:application tramp :machine "foo") 'remote-terminfo)) (Note: "dumb-emacs-ansi" comes from the ncurses-term package[1] in Debian, and should be a good value to represent comint's capabilities.) This lets the user pass a terminfo-friendly value for TERM to the remote system, even if the local system doesn't use terminfo. Then programs on the remote system can consult terminfo to their hearts' content. I've attached a patch that does this, assuming the reasoning above makes sense. Perhaps it also warrants an entry in NEWS? I wasn't sure... [1] https://packages.debian.org/buster/all/ncurses-term/filelist --------------1651D900213E791DBF272BE2 Content-Type: text/plain; charset=UTF-8; name="0001-lisp-comint.el-comint-term-environment-Make-it-conne.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*0="0001-lisp-comint.el-comint-term-environment-Make-it-conne.pa"; filename*1="tch" RnJvbSBmMmQyNDdiNTIwMWRhMDFhMTliODdlM2IxN2E5MDg5MWExOWM0YzYwIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IFR1ZSwgMjYgT2N0IDIwMjEgMTU6MTg6NDMgLTA3MDAKU3ViamVjdDogW1BB VENIXSAqIGxpc3AvY29taW50LmVsIChjb21pbnQtdGVybS1lbnZpcm9ubWVudCk6IE1ha2Ug aXQKIGNvbm5lY3Rpb24tYXdhcmUuCgotLS0KIGxpc3AvY29taW50LmVsIHwgMTMgKysrKysr Ky0tLS0tLQogMSBmaWxlIGNoYW5nZWQsIDcgaW5zZXJ0aW9ucygrKSwgNiBkZWxldGlvbnMo LSkKCmRpZmYgLS1naXQgYS9saXNwL2NvbWludC5lbCBiL2x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gKGxp c3QgIlRFUk09ZW1hY3MiCisgICAgICAgICAgIChmb3JtYXQgIlRFUk1DQVA9ZW1hY3M6Y28j JWQ6dGM9dW5rbm93bjoiICh3aW5kb3ctd2lkdGgpKSkpKSkKIAogKGRlZnVuIGNvbWludC1u b25ibGFuay1wIChzdHIpCiAgICJSZXR1cm4gbm9uLW5pbCBpZiBTVFIgY29udGFpbnMgbm9u LXdoaXRlc3BhY2Ugc3ludGF4LiIKLS0gCjIuMjUuMQoK --------------1651D900213E791DBF272BE2--