aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/tui
Commit message (Collapse)AuthorAge
* TUI: Konsole DECSCUSR fixup (#9423)Justin M. Keyes2019-01-01
| | | | | | | Apparently Konsole's terminfo is still broken. ref #9364 closes #9420
* 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`).
* | TUI: attrs -> attr_id refactorBjörn Linse2018-11-11
| |
* | UI/TUI: improvements and cleanups for scrolling and clearingBjörn Linse2018-11-11
|/ | | | | | | | | | | | - TUI: _never_ rely on BCE for implicit clearing, only explicit commands. - TUI: use unibi_erase_chars when possible. - TUI: use end-exclusive ranges for invalid and cleared areas - screen: scrolling leaves scrolled in aree undefined. This is a conservative change, a client assuming the old semantics will still behave correctly. - screen: factor out vsep handling from line drawing. This is needed anyway for the multigrid refactor. - screen: simplifications of win_do_lines
* TUI: Avoid reset_cursor_color in old VTE #9191Sam Wilson2018-11-03
| | | | closes #9089
* tui.c: Fix ext.set_underline_color for !has_colon_rgbJustin M. Keyes2018-10-20
| | | | PVS/V523: The 'then' statement is equivalent to the 'else' statement.
* Merge pull request #9079 from bfredl/tui_cursorBjörn Linse2018-10-09
|\ | | | | TUI cursor fixes: avoid memory errors after resize with invalid cursor position
| * TUI: delete "first-row" workaround after resizeBjörn Linse2018-10-06
| | | | | | | | | | This was caused by cursor position being invalid right after tui_grid_resize, which is now fixed
| * TUI: always use safe cursor movement after resizeBjörn Linse2018-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code could lead to a memory error in the following situation: 0. The previous cursor position was row 50 since before, on a grid larger than 50 rows. 1. grid_resize changes the grid height to 40, and invalidly assumes the resize moved the physical cursor to row 0 2. Some event used a operation that could move the cursor (such as clear), and then reset the cursor to the "true" position row 50 (pointless after #8221, but I forgot to remove it) 3. raw_line/cheap_to_print is invoked, and tries to inspect the grid at row 50 (memory error) 4. grid_cursor_goto would have been called at this point, and set a valid cursor position 0-39.
* | Merge #9036 'func_attr_printf'Justin M. Keyes2018-10-07
|\ \ | |/ |/|
| * add func_attr_printf in :MichaHoffmann2018-09-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | log.c message.c strings.c fixed some printf warnings in: src/nvim/undo.c src/nvim/eval.c src/nvim/eval/encode.c src/nvim/eval/typval.c src/nvim/ex_getln.c src/nvim/fileio.c src/nvim/lua/executor.c src/nvim/main.c src/nvim/regexp_nfa.c src/nvim/shada.c src/nvim/spellfile.c src/nvim/tui/terminfo.c src/nvim/garray.h
* | TUI: check libvte version for undercurl support #9088Daniel Hahler2018-10-05
| | | | | | | | | | Support was added in https://github.com/GNOME/vte/commit/efaf8f3c. Fixes #9083
* | TUI: fix support for undercurl/underline color #9080Daniel Hahler2018-10-03
| |
* | Merge pull request #9052 from blueyed/undercurlBjörn Linse2018-10-02
|\ \ | | | | | | tui: add support for undercurl and colored underline
| * | tui: add support for undercurl and underline colorDaniel Hahler2018-10-01
| | | | | | | | | | | | Fixes https://github.com/neovim/neovim/issues/7479.
* | | ui: rename ext_newgrid to ext_linegridBjörn Linse2018-10-01
| | |
* | | Revert "TUI: terminfo_start: use unibi_from_term directly"Justin M. Keyes2018-10-01
| | | | | | | | | | | | | | | | | | | | | If $TERM is not defined then unibi_from_term() would crash. Reverts 3bdc34d0657d223599afdf0ce9b072fafa3d5648. ref #9072
* | | TUI: terminfo_start: use unibi_from_term directly (#9072)Daniel Hahler2018-09-30
|/ / | | | | | | | | Avoids redundant call to `getenv("TERM")`. Ref: https://github.com/mauke/unibilium/blob/e3b16d6219ca1cb92d98b1d9cc416b49a3ac468e/uniutil.c#L203-L211
* | tui: eliminate scrolling region data structureBjörn Linse2018-09-27
| | | | | | | | | | | | | | | | | | The scrolling region is always local to a single grid_scroll event, use local variables and parameters instead. The invocation of reset_scroll_region in grid_resize is cargo-culted to use margin reset under exactly the same circumstances, not sure if it is necessary though.
* | tui: eliminate grid->attrs, use indexed cell->attrBjörn Linse2018-09-26
| | | | | | | | remove dead ugrid_put
* | TUI: Alacritty supports DECSCUSR (#9048)Christian Duerr2018-09-25
| | | | | | Alacritty may set TERM to"alacritty" or "alacritty-direct" if it finds its terminfo.
* | minor: tui: update_attrs: code consistencyDaniel Hahler2018-09-23
|/
* TUI: Reset cursor color when applicable #8572Yichao Zhou2018-09-22
| | | | | | | | | | | | | | | | | | | | | | | | Resets the TUI cursor color if: - current 'guicursor' mode does not specify a highlight group - cursor highlight group has "inverse" or "reverse" flag - on Nvim exit We interpret, "inverse" to mean "default cursor". Example: hi Cursor guifg=bg guibg=fg set termguicolors set guicursor=n-v-c-sm:block,i-ci-ve:ver25-Cursor,r-cr-o:hor20 * When the cursor shape is block, its color will be "inverse" * When the cursor shape is I-beam, its color will be `hi Cursor`. This is useful e.g. to prevent `set listchars=eol:¬` causing your cursor color to a low contrast color in insert mode because you cursor are often at EOL in insert mode. close #8572
* cleanup/TUI: remove old unused code #9013Justin M. Keyes2018-09-19
| | | | | | | | - Checks for ECHOE, ICANON were left over from Vim code. We already reference the symbols elsewhere without checking. - newline_on_exit, intr_char: Both are vestigial remnants of Vim 4.x, not implemented in Nvim. intr_char is a termios/stty feature, it's probably not useful because users have other ways to configure their terminals.
* TUI: Skip redundant "stop" event (macOS kernel panic) (#9007)Justin M. Keyes2018-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the TUI suspends (:suspend, CTRL-z) it calls tui_terminal_stop (but does NOT set `ui->data=NULL`, so `tui_is_stopped` returns false). If the host terminal dies, it sends SIGCONT, SIGHUP (usually in that order): ERROR 2018-09-16T19:30:17.065 25821 suspend_event:1153: SIGCONT ERROR 2018-09-16T19:30:17.065 25821 on_signal:162: SIGHUP ERROR 2018-09-16T19:30:17.155 25821 on_signal:162: SIGHUP Race: if SIGHUP is handled before SIGCONT, it calls ui_builtin_stop() which schedules tui_stop before the TUI was resumed? libuv uv_close() aborts if the handle is already closed/closing. Somehow that causes macOS to panic. #8075 Assertion failed: (!uv__is_closing(handle)), function uv_close, file src/unix/core.c, line 117. Thread 0:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x00007fff67d69ec2 kevent + 10 1 libuv.1.dylib 0x000000010609304d uv__io_poll + 892 2 libuv.1.dylib 0x0000000106083904 uv_run + 339 3 nvim 0x0000000105e76f7b loop_poll_events + 74 4 nvim 0x0000000105fa5f51 ui_bridge_stop + 206 5 nvim 0x0000000105fa4c00 ui_builtin_stop + 50 6 nvim 0x0000000105f26ee9 mch_exit + 29 7 nvim 0x0000000105eda84a getout + 518 8 nvim 0x0000000105e778b3 multiqueue_process_events + 77 9 nvim 0x0000000105f24c5a os_breakcheck + 49 10 nvim 0x0000000105eb7ea3 auto_next_pat + 463 11 nvim 0x0000000105eb7603 apply_autocmds_group + 1289 12 nvim 0x0000000105eb0e8d apply_autocmds + 36 13 nvim 0x0000000105f5a412 screenalloc + 1892 14 nvim 0x0000000105f5b223 screen_resize + 190 15 nvim 0x0000000105fa52e3 ui_refresh + 257 16 nvim 0x0000000105e8c3d9 do_cmdline + 6614 17 nvim 0x0000000105f03a72 normal_execute + 3996 18 nvim 0x0000000105f89925 state_enter + 164 19 nvim 0x0000000105efe08d normal_enter + 125 20 nvim 0x0000000105ed9ffd main + 6858 21 libdyld.dylib 0x00007fff67c19115 start + 1 Thread 1 Crashed: 0 libsystem_kernel.dylib 0x00007fff67d68e3e __pthread_kill + 10 1 libsystem_pthread.dylib 0x00007fff67ea7150 pthread_kill + 333 2 libsystem_c.dylib 0x00007fff67cc5312 abort + 127 3 libsystem_c.dylib 0x00007fff67c8d368 __assert_rtn + 320 4 libuv.1.dylib 0x00000001060835bf uv_close + 247 5 nvim 0x0000000105fa0ebb tui_terminal_stop + 221 6 nvim 0x0000000105f9ff3d tui_stop + 14 7 nvim 0x0000000105e778b3 multiqueue_process_events + 77 8 nvim 0x0000000105fa0c89 tui_main + 302 9 libsystem_pthread.dylib 0x00007fff67ea46c1 _pthread_body + 340 10 libsystem_pthread.dylib 0x00007fff67ea456d _pthread_start + 377 11 libsystem_pthread.dylib 0x00007fff67ea3c5d thread_start + 13 TODO: - Set `ui->data = NULL` to flag UI as "stopped"? But loop_poll_events drains *all* fast_events, so could skip some events...
* tui: Hint wrapped lines to terminals.Ricky Zhou2018-09-03
| | | | | | | | | | | | | | | | Previously, when neovim would wrap a line across multiple lines, terminal emulators could not detect that the lines represent a single wrapped line as opposed to several separate lines. As a result, many terminals' selection/copying functionality would treat a wrapped line as several newline-delimited lines. Fix this by reenabling a "special trick" from Vim. When a line is wrapped, write the last character of that line followed by the first character of the next line to the terminal. This hints to the terminal that the next line is a continuation of the current line. Extends the raw_line event with a "wrap" parameter which controls when to do wrap hinting.
* TUI: use BCE again more often, as it provides smoother resizes and scrollingBjörn Linse2018-08-14
| | | | add exceptions for terminals we know doesn't support BCE
* tui: reenable cursor movement optimizations (leftover from #8221)Björn Linse2018-08-14
|
* tui: hack for invalid first line with non-bce resizeBjörn Linse2018-08-14
|
* tui: use bce properlyBjörn Linse2018-08-14
|
* cursor_shape: use attribute ids instead of syntax idsBjörn Linse2018-08-13
| | | | | As attribute ids is the convention in the UI protocol Also remove non-threadsafe calls in tui.c to syntax module.
* highlight: HlAttrs is a value type; treat it like suchBjörn Linse2018-08-13
|