vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 184a749ff9fe38191bf0ef463fb844d967cdfe6e parent 2e8c362e34955e522bd81ba32c41a973af098295 Author: Marc André Tanner <mat@brain-dump.org> Date: Wed, 11 Nov 2015 22:51:10 +0100 ui: fall back to xterm-256color if term initialization fails This improves behaviour for unknwown/unrecognized terminals as is the case for self contained binaries built with "make standalone" which only includes a fixed set of terminal descriptions. Of course the terminal capabilities won't match, which will likely cause some display issues. Diffstat:
| M | ui-curses.c | | | 7 | +++++-- |
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/ui-curses.c b/ui-curses.c @@ -1079,8 +1079,11 @@ Ui *ui_curses_new(void) { char *term = getenv("TERM"); if (!term) term = "xterm"; - if (!newterm(term, stderr, stdin)) - goto err; + if (!newterm(term, stderr, stdin)) { + snprintf(uic->info, sizeof(uic->info), "Warning: unknown term `%s'", term); + if (!newterm("xterm-256color", stderr, stdin)) + goto err; + } start_color(); use_default_colors(); raw();