unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Akib Azmain Turja <akib@disroot.org>
To: Samuel Wales <samologist@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: TERM and shell mode
Date: Fri, 03 Mar 2023 11:05:18 +0600	[thread overview]
Message-ID: <87h6v2fmr5.fsf@disroot.org> (raw)
In-Reply-To: <CAJcAo8s1nhRpyrHMgQ1yMJtRNNW+cvCfSgpr2B4GDWP4JjUTYw@mail.gmail.com> (Samuel Wales's message of "Thu, 2 Mar 2023 17:18:29 -0700")

[-- Attachment #1: Type: text/plain, Size: 2019 bytes --]

Samuel Wales <samologist@gmail.com> writes:

> ok, so this is going to be a really dumb question that i should have
> figured out over the years.  and ... i sorta kinda but not really did
> but i have too many notes and can't fiure them out.
>
> and even legacy shell stuff from xemacs days and such.
>
> emacs -Q says dumb for TERM for shell mode.  one issue with this i
> have a note saying is that colored output can silently corrupt cmd |
> grep if TERM=dumb.  or similr.  idr the details.  but i recall the
> problem and debugged it to the TERM variable.
>
> termprarily setting term to xterm fixed that problem but i have no
> idea where it is being set permanntly.
>

Setting TERM to xterm will fix the issue for some programs, but will
create a big problem when you run Emacs or GNU Screen in Shell mode.
By the way, you can use Coterm to enable full terminal emulation in
Shell mode.

> i can't actually figure out where in my shell code or elsewhere the
> following occurs: TERM gets set to xterm.  it works well or seems to
> but it might be WRONG on the internet.  and root vs. user and linux vt
> console might require special casing.
>
> -Q says supposed to be dumb, except i also recall emacs as a terminal
> type.  dunno where that came from.
>
> literally i have no shell code that sets the var althuogh it is used
> as a prefix to grep and such.  of course i am not asking you to intuit
> where the variable is being set but you might have interesting
> comments about TERM.

It's probably your init file that's responsible.  What does the user
option (variable) 'comint-terminfo-terminal' contain?

>
> example.  thisis probably bad code but it helps with grep
>
>     TERM=xterm \
>         LC_ALL=C grep -i --color=auto --devices=skip --directories=skip "$@"

-- 
Akib Azmain Turja, GPG key: 70018CE5819F17A3BBA666AFE74F0EFA922AE7F5
Fediverse: akib@hostux.social
Codeberg: akib
emailselfdefense.fsf.org | "Nothing can be secure without encryption."

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  parent reply	other threads:[~2023-03-03  5:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03  0:18 TERM and shell mode Samuel Wales
2023-03-03  1:37 ` Emanuel Berg
2023-03-03  1:39 ` Emanuel Berg
2023-03-03  5:05 ` Akib Azmain Turja [this message]
2023-03-03  7:21 ` Eli Zaretskii
2023-03-03  7:39   ` Emanuel Berg
2023-03-09  0:53   ` Samuel Wales
2023-03-09  4:47     ` Akib Azmain Turja

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=87h6v2fmr5.fsf@disroot.org \
    --to=akib@disroot.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=samologist@gmail.com \
    /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.
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).