Gentoo Archives: gentoo-user

From: Grant Taylor <gtaylor@×××××××××××××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Globally Disable Prompt Formatting, In All Programs Everywhere For All Time
Date: Thu, 17 May 2018 17:07:19
Message-Id: 8cc14f94-cd00-b58e-f4e5-75f9659db6fa@spamtrap.tnetconsulting.net
In Reply to: [gentoo-user] Globally Disable Prompt Formatting, In All Programs Everywhere For All Time by R0b0t1
1 On 05/16/2018 03:11 PM, R0b0t1 wrote:
2 > Today, I feel the need to ask about how to Globally Disable Prompt
3 > Formatting, In All Programs Everywhere For All Time.
4
5 I'm not aware of a universal way to disable prompt formatting.
6
7 Are you talking specifically about the shell prompt?
8
9 What other things are using prompt formatting? (I've added it to a few
10 things via rlwrap, but I doubt that's the case here.)
11
12 > Is the only way to find every program that generates escape sequences
13 > and disable it? What about kernel messages during boot?
14
15 I want to say that things should be leveraging TERMCAP and the TERM
16 environment variable. However, I don't think /any/ of the things that
17 I've read about (shell) prompt formatting have taken TERMCAP into
18 account. Instead they all seem to echo raw vt100 escape codes directly.
19
20 I don't even know how to pass through something like TERMCAP to leverage
21 the TERM environment variable setting.
22
23 I don't know if it's your case or not, but if you are talking about the
24 shell's PROMPT blindly echoing escape characters and impacting various
25 terminal emulators that you're using, I think the shell itself is the
26 first (and likely only) place to look.
27
28 I have personally run into this problem and solved it differently. I
29 configure a fairly fancy prompt (both left and right in Zsh). But I do
30 so conditionally based on what the answer back value is. Part of my
31 shell's init scripts query the answer back and expect specific values.
32 If those values aren't seen, then a very simple prompt (without any
33 escape codes) is used.
34
35 This means that I must configure my terminal (emulators) to reply with
36 something (usually the host name) and then tweak my init script to match
37 the host name as a known safe place for my fancy prompt.
38
39 I doubt that this directly answers your question, nor do I know if it
40 helps or not. Hopefully it gives you food for thought.
41
42
43
44 --
45 Grant. . . .
46 unix || die