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
This commit is contained in:
Russ Cox 2013-08-06 09:42:10 -04:00
parent 2bc9a13faf
commit bf63f986ff
4 changed files with 13 additions and 1 deletions

View file

@ -15,6 +15,7 @@
#include "fns.h"
#include "term.h"
const char *termprog = "9term";
int use9wm;
int mainpid;
int mousepid;

View file

@ -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:

View file

@ -10,3 +10,4 @@ extern int loginshell;
extern void echoed(char*, int);
extern int echocancel(char*, int);
extern int dropcrnl(char*, int);
extern const char *termprog;

View file

@ -5,6 +5,7 @@
#include <9pclient.h>
#include "term.h"
const char *termprog = "win";
#define EVENTSIZE 256
#define STACK 32768