git.y1.nz

mtm

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

commit 5f9931d437b5141c972485b194ebe4ecb1fd3c06
parent 44c0c27dc6bbbd0e997f25fa36ba72238b60d434
Author: Rob King <jking@deadpixi.com>
Date:   Wed, 22 Feb 2017 22:18:21 -0600

Added the -u option.

Diffstat:
Mmtm.14++++
Mmtm.c7++++---
2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/mtm.1 b/mtm.1 @@ -7,6 +7,7 @@ .Sh SYNOPSIS .Nm .Op Fl m +.Op Fl u .Op Fl c Ar CHARACTER .Sh DESCRIPTION .Nm @@ -29,6 +30,9 @@ do not use color of any sort. By default, .Nm will run in color mode. +.It Fl u +Use Unicode box drawing characters; +this should be specified only if your system's wide-character type corresponds to Unicode. .It Fl c Ar CHARACTER Commands are prefixed using .Ar CHARACTER diff --git a/mtm.c b/mtm.c @@ -50,7 +50,7 @@ struct NODE{ }; static NODE *root, *focused; -static bool monochrome, cmd; +static bool monochrome, unicode, cmd; static int commandkey = CTL(COMMAND_KEY), nfds = 1; /* stdin */ static fd_set fds; static char iobuf[BUFSIZ + 1]; @@ -169,7 +169,7 @@ newview(NODE *p, int y, int x, int h, int w) return freenode(n, false), NULL; else if (pid == 0){ setsid(); - setenv("NCURSES_NO_UTF8_ACS", "1", 1); + if (unicode) setenv("NCURSES_NO_UTF8_ACS", "1", 1); setenv("TERM", monochrome? "mach" : "mach-color", 1); signal(SIGCHLD, SIG_DFL); execl(getshell(), getshell(), NULL); @@ -477,10 +477,11 @@ main(int argc, char **argv) signal(SIGCHLD, SIG_IGN); int c = 0; - while ((c = getopt(argc, argv, "mc:")) != -1){ + while ((c = getopt(argc, argv, "umc:")) != -1){ switch (c){ case 'm': monochrome = true; break; case 'c': commandkey = CTL(optarg[0]); break; + case 'u': unicode = true; break; default: quit(EXIT_FAILURE, USAGE); 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.