diff options
author | Russ Cox <rsc@swtch.com> | 2011-10-11 09:34:25 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2011-10-11 09:34:25 -0400 |
commit | 0e881c054a76801032e640db3947e0602cfccbeb (patch) | |
tree | 755f0febb2c574736c397d1ebac507e93ec430b2 /src/cmd/9term | |
parent | f9c8cdb5a6b612f49ee544bba9024081852fdaf1 (diff) | |
download | plan9port-0e881c054a76801032e640db3947e0602cfccbeb.tar.gz plan9port-0e881c054a76801032e640db3947e0602cfccbeb.tar.bz2 plan9port-0e881c054a76801032e640db3947e0602cfccbeb.zip |
9term: hold mode back door
R=rsc
http://codereview.appspot.com/5248056
Diffstat (limited to 'src/cmd/9term')
-rw-r--r-- | src/cmd/9term/9term.c | 11 | ||||
-rw-r--r-- | src/cmd/9term/win.c | 28 |
2 files changed, 23 insertions, 16 deletions
diff --git a/src/cmd/9term/9term.c b/src/cmd/9term/9term.c index 344a7b55..ed68ed19 100644 --- a/src/cmd/9term/9term.c +++ b/src/cmd/9term/9term.c @@ -468,9 +468,14 @@ label(Rune *sr, int n) dir = smprint("%.*S", (el-1)-(sl+3), sl+3); if(dir){ - drawsetlabel(dir); - free(w->dir); - w->dir = dir; + if(strcmp(dir, "*9term-hold+") == 0) { + w->holding = 1; + wrepaint(w); + } else { + drawsetlabel(dir); + free(w->dir); + w->dir = dir; + } } /* remove trailing /-sysname if present */ diff --git a/src/cmd/9term/win.c b/src/cmd/9term/win.c index e5d21416..e08e032c 100644 --- a/src/cmd/9term/win.c +++ b/src/cmd/9term/win.c @@ -598,20 +598,22 @@ label(char *sr, int n) return n; *r = 0; - /* - * add /-sysname if not present - */ - snprint(wdir, sizeof wdir, "name %s", sl+3); - p = strrchr(wdir, '/'); - if(p==nil || *(p+1) != '-'){ - p = wdir+strlen(wdir); - if(*(p-1) != '/') - *p++ = '/'; - *p++ = '-'; - strcpy(p, name); + if(strcmp(sl+3, "*9term-hold+") != 0) { + /* + * add /-sysname if not present + */ + snprint(wdir, sizeof wdir, "name %s", sl+3); + p = strrchr(wdir, '/'); + if(p==nil || *(p+1) != '-'){ + p = wdir+strlen(wdir); + if(*(p-1) != '/') + *p++ = '/'; + *p++ = '-'; + strcpy(p, name); + } + strcat(wdir, "\n0\n"); + fswrite(ctlfd, wdir, strlen(wdir)); } - strcat(wdir, "\n0\n"); - fswrite(ctlfd, wdir, strlen(wdir)); memmove(sl, el, er-el); n -= (el-sl); |