summaryrefslogtreecommitdiffstats
path: root/src/cmd/9term/rcstart.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2013-08-06 09:42:10 -0400
committerRuss Cox <rsc@swtch.com>2013-08-06 09:42:10 -0400
commitbf63f986ff1a433ab6cce5287d51c191036f0a65 (patch)
tree62dbd26446e930d0d5a841be9dcd1a43667212cd /src/cmd/9term/rcstart.c
parent2bc9a13faf0abcfa43cddc8c226b2f742b764c4a (diff)
downloadplan9port-bf63f986ff1a433ab6cce5287d51c191036f0a65.tar.gz
plan9port-bf63f986ff1a433ab6cce5287d51c191036f0a65.zip
9term: set TERM=dumb instead of TERM=9term
Everyone seems to assume that TERM != dumb implies ANSI escape codes are okay. In fact, many people assume that unconditionally, but it is easier to argue back about TERM=dumb than TERM=9term. This applies to acme win too, because they share the code. Set termprog=9term or termprog=win for clients who need to know. R=rsc CC=r https://codereview.appspot.com/12532043
Diffstat (limited to 'src/cmd/9term/rcstart.c')
-rw-r--r--src/cmd/9term/rcstart.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/cmd/9term/rcstart.c b/src/cmd/9term/rcstart.c
index 6b91c869..9bfefdaa 100644
--- a/src/cmd/9term/rcstart.c
+++ b/src/cmd/9term/rcstart.c
@@ -77,7 +77,16 @@ rcstart(int argc, char **argv, int *pfd, int *tfd)
*/
notifyoff("sys: window size change");
- putenv("TERM", "9term");
+ // This used to be TERM=9term but we don't know of anything that cares.
+ // Worse, various cc have started assuming that TERM != dumb implies
+ // the ability to understand ANSI escape codes. 9term will squelch them
+ // but acme win does not.
+ putenv("TERM", "dumb");
+
+ // Set $termprog to 9term or win for those who care about what kind of
+ // dumb terminal this is.
+ putenv("termprog", (char*)termprog);
+
pid = fork();
switch(pid){
case 0: