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:
parent
2bc9a13faf
commit
bf63f986ff
4 changed files with 13 additions and 1 deletions
|
|
@ -15,6 +15,7 @@
|
||||||
#include "fns.h"
|
#include "fns.h"
|
||||||
#include "term.h"
|
#include "term.h"
|
||||||
|
|
||||||
|
const char *termprog = "9term";
|
||||||
int use9wm;
|
int use9wm;
|
||||||
int mainpid;
|
int mainpid;
|
||||||
int mousepid;
|
int mousepid;
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,16 @@ rcstart(int argc, char **argv, int *pfd, int *tfd)
|
||||||
*/
|
*/
|
||||||
notifyoff("sys: window size change");
|
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();
|
pid = fork();
|
||||||
switch(pid){
|
switch(pid){
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
||||||
|
|
@ -10,3 +10,4 @@ extern int loginshell;
|
||||||
extern void echoed(char*, int);
|
extern void echoed(char*, int);
|
||||||
extern int echocancel(char*, int);
|
extern int echocancel(char*, int);
|
||||||
extern int dropcrnl(char*, int);
|
extern int dropcrnl(char*, int);
|
||||||
|
extern const char *termprog;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
#include <9pclient.h>
|
#include <9pclient.h>
|
||||||
#include "term.h"
|
#include "term.h"
|
||||||
|
|
||||||
|
const char *termprog = "win";
|
||||||
|
|
||||||
#define EVENTSIZE 256
|
#define EVENTSIZE 256
|
||||||
#define STACK 32768
|
#define STACK 32768
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue