aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/tui
Commit message (Collapse)AuthorAge
...
* tui: support rgba background detection (#10205)Harm te Hennepe2019-06-13
| | | Fixes https://github.com/neovim/neovim/issues/10159.
* TUI: set os/input.c:global_fd to input->in_fd #10174erw72019-06-10
| | | | | | | | | | | | | Problem: When we changed startup to wait for the TUI (like a remote UI), we forgot to set os/input.c:global_fd. That used to be done by input_start(). Solution: Initialize os/input.c:global_fd before initializing libtermkey (termkey_new_abstract) so that tui_get_stty_erase() and friends can inspect the correct fd. fixes #10134 close #10174
* Merge #9829 'startup: remove TUI init special-case'Justin M. Keyes2019-06-04
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | fixes #7967 fixes #9959 Historically Vim/Nvim does backflips to handle input and show messages before a UI is available. This logical contradiction was already fixed for remote UIs (#9024 c236e80cf3df). Fixing it also for the TUI avoids problems on Windows, simplifies the logic, and avoids races like #9959. - Move ui_builtin_start() to the same position as embedded_mode remote_ui_wait_for_attach(). - If stdin is redirected, save the original `stdin` and replace fd 0 with tty before calling `ui_builtin_start()`.
| * [skip appveyor] Fix clint issueerw72019-06-04
| |
| * tui/input.c: Fix problem when stdin is not TTYerw72019-06-04
|/
* tui:cursor_goto(): remove dead code #9952Justin M. Keyes2019-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | fix #9918 ref dbc25f5a87cf3bcfe1caac1eb1ff8b3a6978a415 Before 7ede14d191b1 the UGRID_FOREACH_CELL loop was never entered, because it expanded to an always-false condition. From build/src/nvim/auto/tui/tui.i: do { UCell *row_cells = (grid)->cells[grid->row]; for (int col = grid->col; col < col; col++) { UCell *cell = row_cells + col; (void)(cell); { print_cell(ui, cell); }; } } while (0); After 7ede14d191b1 issue #9918 was reported. $ ./build/bin/nvim -Nu NONE +'colo evening' :h<tab> " causes cursor to change colors Since the code was dead before 7ede14d191b1, just remove it.
* win: stream_init() issue with tty on Windows #9884erw72019-04-28
| | | ref #9825
* tui/input.c: rename functionsJustin M. Keyes2019-03-25
| | | | | | | | - Rename the module prefix to "tinput_" instead of "term_input". - Some of the private functions were confusing, for example enqueue_input() calls input_enqueue() in another module. - It is helpful for discussion, documentation, and stacktraces if functions (even private) are globally unique.
* autocmd: rename: "++nested", "++once"Justin M. Keyes2019-03-14
| | | | | Based on feedback from upstream: https://github.com/vim/vim/pull/4100
* TUI/background detection: hook into VimEnter eventJustin M. Keyes2019-03-11
| | | | | | | | | | | If terminal response is received during startup, set 'background' from a nested "one-shot" (once) VimEnter autocmd. The previous not-so-clever "self-rescheduling" approach could cause a long delay at startup (event-loop does not make forward progress). fixes #9675 ref #9509
* tui_tk_ti_getstr: handle weird value #9688Boskovits2019-03-07
| | | | | | | | | tigetstr (used by libtermkey/driver-ti.c) may return -1 as a pointer. Documented in man 3 tigetstr. https://linux.die.net/man/3/tigetstr > The tigetstr routine returns the value (char *)-1 if capname is not a string > capability, or 0 if it is canceled or absent from the terminal description. Fixed #9687
* floats: implement floating windowsBjörn Linse2019-03-02
| | | | Co-Author: Dongdong Zhou <dzhou121@gmail.com>
* TUI: do not resize host-terminal on startup (#9645)Justin M. Keyes2019-02-25
| | | | | | ...unless the 'lines' and/or 'columns' options were set. ref 5732340c2035 fixes #5843
* TUI: rework background-color detectionJustin M. Keyes2019-02-22
| | | | | | | | | - Like Vim, use set_option_value() followed by reset_option_was_set(). - Do not use set_string_default(), so the default is predictable. This affects `:set bg&`. - Wait until end-of-startup (VimEnter) to handle the response. The response is racey anyways, so timing is irrelevant. This allows OptionSet to be triggered, unlike during startup.
* Merge #5027 'TUI: detect background color'Justin M. Keyes2019-02-17
|\
| * Merge #5027 'TUI: detect background color'Justin M. Keyes2019-01-17
| |\
| | * Automatically detect terminal background and set bg=dark or bg=lightJosh Triplett2016-07-24
| | | | | | | | | | | | | | | | | | | | | | | | xterm-compatible terminals support reporting their configured colors back to the application. Use this to obtain the current background color, compute its luminance to classify it as light or dark, and set 'bg' accordingly. Also set the default for 'bg', so that `:set bg&` will revert to that detected default.
* | | TUI: assume italics support in all xterm-likesJustin M. Keyes2019-02-12
| | | | | | | | | | | | | | | | | | https://github.com/neovim/neovim/issues/9598#issuecomment-462421302 > On systems other than macOS, terminfo always has them set. It's part > of the ANSI standard SGR codes
* | | TUI: sniff nsterm (Terminal.app) from $TERM_PROGRAMJustin M. Keyes2019-02-11
| | |
* | | TUI: force italics in tmuxJustin M. Keyes2019-02-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tmux users are encouraged to use "tmux-256color" instead of the old "screen-256color". Put this in your .tmux.conf : if-shell 'infocmp tmux-256color' 'set -g default-terminal "tmux-256color"' 'set -g default-terminal "screen-256color"' If default-terminal is "tmux-256color" AND tmux finds its terminfo, THEN it will enable italics (regardless of whether the terminfo contains sitm/ritm). OTHERWISE tmux "emulates screen", which means it emits italics as "reverse". That's unfortunate, but it's an acceptable compromise that allows Nvim to support italics in tmux by default in compatible (and increasingly-common) configurations. Test case: tmux nvim -u NORC +'hi Comment cterm=italic' CMakeLists.txt ref #9598
* | | TUI: italics in Terminal.app (nsterm)Justin M. Keyes2019-02-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the conservative approach, requiring TERM=nsterm as recommended at `:help $TERM`. It won't work with Terminal.app's default of TERM=xterm-256color, nor in tmux. Test case: TERM=nsterm nvim -u NORC +'hi Comment cterm=italic' CMakeLists.txt closes #9598
* | | ui/compositor: add redraws needed due to intersected doublewidth chars.Björn Linse2019-02-02
|/ /
* | win/TUI: fix text overrides line numbers #9474erw72019-01-09
| | | | | | fixes #9461
* | PVS/V751: tui.c, Parameter is not usedJustin M. Keyes2019-01-04
| | | | | | | | | | False positive. Documentation for grid_scroll says "`cols` is always zero, reserved for future use".
* | Merge #9425 'build: enable -Wshadow'Justin M. Keyes2019-01-03
|\ \
| * | UGRID_FOREACH_CELL: avoid shadowed variablesJustin M. Keyes2019-01-02
| | |
| * | build: enable -WshadowJustin M. Keyes2019-01-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note about shada.c: - shada_read_next_item_start was intentionally shadowing `unpacked` and `i` because many of the macros (e.g. ADDITIONAL_KEY) implicitly depended on those variable names. - Macros were changed to parameterize `unpacked` (but not `i`). Macros like CLEAR_GA_AND_ERROR_OUT do control-flow (goto), so any other approach is messy.
* | | TUI: Do not disable BCE for builtin terminfos (#9443)Justin M. Keyes2019-01-02
|/ / | | | | | | | | | | | | | | | | Remove this vestigial hack from #7624. Since 5a0d0286ff4d we blacklist BCE more surgically. And patch_terminfo_bugs() is the more appropriate place for that. ref 5749ecaf228f4a963a4e96ada831f902c73a1e80 ref #4210 #4421 #7035 #7337 #7381 #7425 #7618
* | TUI: Konsole DECSCUSR fixup (#9423)Justin M. Keyes2018-12-31
| | | | | | | | | | | | Apparently Konsole's terminfo is still broken. ref #9364 closes #9420
* | Merge #9408 from justinmk/tui-title-stackingJustin M. Keyes2018-12-31
|\ \ | | | | | | TUI: attempt "title stacking" unconditionally
| * | TUI: attempt "title stacking" unconditionallyJustin M. Keyes2018-12-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework #9407: save/restore title/icon always (for all terminals). Works in tmux, iTerm2, xterm, and any other terminal that supports title-stacking. Test case (title is "foo" while running, then restored after exit): tmux nvim -u NONE +'set title titlestring=foo' :q closes #4063
* | | Merge #9401 from justinmk/pr-win-erw7Justin M. Keyes2018-12-30
|\ \ \ | |/ / |/| |
| * | win/TUI: ConEmu: get back_color_erase from terminfoJustin M. Keyes2018-12-30
| | | | | | | | | | | | | | | | | | We already set back_color_erase in our builtin terminfo (terminfo_defs.h:conemu_terminfo), so we don't need to set it explicitly in patch_terminfo_bugs().
| * | refactor: Extract os_tty_guess_term()Justin M. Keyes2018-12-30
| | | | | | | | | | | | | | | - Also remove feature-detection of uv_set_vterm_state(): instead, on Windows we always require libuv to have that function.
| * | update_terminfo.sh: NOLINT data arraysJustin M. Keyes2018-12-28
| | |
| * | Merge 'upstream/master' into pr-win-erw7Justin M. Keyes2018-12-27
| |\ \
| * | | win/TUI: Fix scroll on Windows legacy consoleerw72018-12-27
| | | |
| * | | win/TUI: ConEmu: set immediate_wrap_after_last_column #9094erw72018-12-27
| | | |
| * | | win/TUI: builtin terminfos for cygwin, conemu, et al.erw72018-12-27
| | | |
| * | | win/TUI: SetConsoleMode() to override libuv #9094erw72018-12-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use uv_set_vterm_state() to override libuv's guess. See https://github.com/libuv/libuv/pull/1873/ for discussion. This commit uses a terminal-detection approach based on GetProcessImageFileNameW(...), which will be reverted in the following commit. The approach was intended to handle the case of running in winpty (:terminal), but we will add $NVIM env var for that. Also add some support for ConEmu, cygwin.
* | | | TUI: enter/exit alternate screen with "title stacking" (#9407)Justin M. Keyes2018-12-29
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Works in iTerm2 and xterm. - patch_terminfo_bugs(): Add title-stacking sequences (\e[22t and \e[23t) to the overrides for iTerm2 and xterm. - Note: the builtins (terminfo_defs.h) for `iterm_256colour_terminfo` and `xterm_256colour_terminfo` already include the sequences. Test case (title should be "foo" after the final :q): TERM=iterm2 nvim -u NONE +'set title titleold=foo' :q TERM=iterm2 nvim -u NONE +'set title titlestring=zub' :q closes #4063
* | | TUI: TERM=nstermJustin M. Keyes2018-12-16
| | | | | | | | | | | | | | | | | | | | | Treat TERM=nsterm the same way in augment_terminfo() and patch_terminfo_bugs(). ref #9244 463d28cc8079
* | | TUI: detect BSD vt consoleJustin M. Keyes2018-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FreeBSD console sets TERM=xterm, but it does not support xterm features like cursor-shaping. GUI terminals typically set TERM=xterm-256color, so on FreeBSD we can guess that TERM=xterm is the degraded vt. OpenBSD console sets TERM=vt220 https://github.com/openbsd/src/blob/master/etc/etc.amd64/ttys NetBSD console sets TERM=vt100 https://github.com/NetBSD/src/blob/trunk/etc/etc.amd64/ttys closes #8644
* | | Merge pull request #9368 from bfredl/doublewrapBjörn Linse2018-12-15
|\ \ \ | | | | | | | | TUI: handle wrap of doublewidth chars correctly
| * | | TUI: handle wrap of doublewidth chars correctlyBjörn Linse2018-12-15
| | | |
* | | | TUI: Konsole 18.07.70 supports DECSCUSR (#9364)Justin M. Keyes2018-12-14
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | ref https://github.com/KDE/konsole/commit/b0d3d83eca4f523a9e4acd3989da6be96033536a KONSOLE_VERSION is exported as a numeric string (after removing the dots from the version string). ref #8300 closes #6778 closes #6798
* | | TUI: alacritty supports set_cursor_color #9353Patrice Peterson2018-12-11
| | | | | | | | | | | | | | | | | | | | | Feature was added in: https://github.com/jwilm/alacritty/pull/757 closes #9353
* | | TUI: don't use BCE with attributes affecting backgroundBjörn Linse2018-12-11
| | |
* | | TUI: set_underline_color: only support colon form #9279Daniel Hahler2018-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes https://github.com/neovim/neovim/issues/9270 --- Background info per egmontkob: https://github.com/neovim/neovim/issues/9270#issuecomment-441979176 For undercurl, the newly invented escape sequence is `4:3` strictly with a colon, as with a semicolon it means single underlined and italic. For colored underline, the newly invented escape sequence `58:...` is meant to follow the pattern of `38` and `48`. [ITU T.416](https://www.itu.int/rec/T-REC-T.416-199303-I/en) § 13.1.8 clearly specifies the colon only as the separator (and the well-known ECMA-48 § 8.3.117 just points to this standard). Using semicolon instead was/is a frequent misinterpretation of this standard, and is commonly used in the wild – for 38 and 48. More and more emulators are catching up and beginning to support colon, in addition to semicolon. Semicolon is pretty fragile; in case an emulator doesn't recognize a sequence (let's say doesn't recognize the new extension of `58`), subsequent numbers are interpreted as other attributes. E.g. if 256-color mode is chosen then the next numeric parameter is `5` which turns on blinking. So, luckily, the standard is the technically better solution, the frequent practice of using semicolons is technically the worse. Therefore the direction we should be going is clear. I believe it's a fair requirement for anyone adopting colored underline to support colons too, and it's a reasonable move from applications to slightly push the world forward, force developers to catch up with the recent changes, that is: 1) recognize and at least ignore colon-delimited parameters even if they aren't supported, 2) recognize and support colon wherever they support the nonstandard semicolon instead. Should you come across any terminal emulator that supports 58 with semicolons but not with colons, I think the cleanest you can do is report a bug against them and ignore the problem; they should fix it. It's yet another common misunderstanding that the truecolor syntax is `38`/`48`/`58` followed by `:2:rrr:ggg:bbb`. The wording of T.416 is terrible, but if you read carefully, there's another parameter of color-space-id preceding the three color channels. Assuming you don't care about color-space-id, the syntax is `38`/`48`/`58` followed by `:2::rrr:ggg:bbb` and of course the trailing `m`. This is only for true-color, the 256-color format doesn't have such a parameter, it's `38`/`48`/`58` followed by `:5:index` and the final `m`.
* | | TUI: support TERM=nsterm (#9244)Justin M. Keyes2018-11-18
| | | | | | | | | | | | | | | | | | | | | `:help $TERM` recommends TERM=nsterm for Terminal.app but we did not actually support it. NB: We don't include a builtin term for Terminal.app, presumably because nsterm is commonly available on most systems (`infocmp nsterm`).