git.y1.nz

mtm

Ncurses-based terminal multiplexer
download: https://git.y1.nz/archives/mtm.tar.gz
Files | Log | Refs

commit 3816851d4a2fd0938c2b1e626e8783cd62e16003
parent 537e103df071d5e933e19d7a255ea08aca472358
Author: Rob King <jking@deadpixi.com>
Date:   Tue, 25 Apr 2017 14:12:18 -0500

Added support for the -T option.

Diffstat:
Mmtm.110++++++++++
Mmtm.c5+++--
2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/mtm.1 b/mtm.1 @@ -9,6 +9,7 @@ .Op Fl b .Op Fl m .Op Fl u +.Op Fl T Ar HOST .Op Fl t Ar TERMINAL .Op Fl c Ar CHARACTER .Sh DESCRIPTION @@ -34,6 +35,15 @@ You probably don't need to use this option. Enable mouse support. When mouse support is enabled, clicking button 1 will focus the virtual terminal under the click. +.It Fl T Ar HOST +Assume that the host terminal +.Po +i.e. the terminal under which +.Nm +is running +.Pc +is of type +.Ar HOST "." .It Fl t Ar TERMINAL Set the .Ev TERM diff --git a/mtm.c b/mtm.c @@ -34,7 +34,7 @@ #define MIN(x, y) ((x) < (y)? (x) : (y)) #define MAX(x, y) ((x) > (y)? (x) : (y)) #define CTL(x) ((x) & 0x1f) -#define USAGE "usage: mtm [-b] [-t NAME] [-c KEY]" +#define USAGE "usage: mtm [-b] [-m] [-T NAME] [-t NAME] [-c KEY]" /*** DATA TYPES */ typedef void (*PRINTER)(WINDOW *win, wchar_t w); @@ -1163,9 +1163,10 @@ main(int argc, char **argv) setlocale(LC_ALL, ""); signal(SIGCHLD, SIG_IGN); /* automatically reap children */ int c = 0; - while ((c = getopt(argc, argv, "mubt:c:")) != -1) switch (c){ + while ((c = getopt(argc, argv, "mubT:t:c:")) != -1) switch (c){ case 'b': kbs = true; break; case 'c': commandkey = CTL(optarg[0]); break; + case 'T': setenv("TERM", optarg, 1); break; case 't': term = optarg; break; case 'm': mouse = true; break; case 'u': /* ignored */ break;

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.