aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal
Commit message (Collapse)AuthorAge
...
* refactor(test): inject after_each differentlyLewis Russell2024-04-10
|
* test(terminal/buffer_spec): use screen:expect(), not retry() (#28246)zeertzjq2024-04-09
| | | | Without creating new lines, using screen:expect() is faster and avoids RPC requests.
* test(terminal/buffer_spec): avoid other keys in double clicks (#28245)zeertzjq2024-04-09
| | | | Having unrelated keys between double clicks may make the test flaky as 'mousetime' is more easily reached.
* test: improve test conventionsdundargoc2024-04-08
| | | | Work on https://github.com/neovim/neovim/issues/27004.
* test: silence expected errorsdundargoc2024-04-02
| | | | This will remove unrelated errors in .nvimlog at the end of test output.
* fix(terminal): fix duplicate recording with mouse click (#28103)zeertzjq2024-03-29
|
* feat(tui): query extended underline support using DECRQSS (#28052)zeertzjq2024-03-28
|
* test(tui_spec): fix flaky test for isolated "stop paste" (#28053)zeertzjq2024-03-27
| | | In rare cases there may be multiple chunks of phase 2 because of timing.
* refactor(tests): all screen tests should use highlightsbfredl2024-03-23
| | | | | | | | | | | | | | | | | | | | | | | This is the first installment of a multi-PR series significantly refactoring how highlights are being specified. The end goal is to have a base set of 20 ish most common highlights, and then specific files only need to add more groups to that as needed. As a complicating factor, we also want to migrate to the new default color scheme eventually. But by sharing a base set, that future PR will hopefully be a lot smaller since a lot of tests will be migrated just simply by updating the base set in place. As a first step, fix the anti-pattern than Screen defaults to ignoring highlights. Highlights are integral part of the screen state, not something "extra" which we only test "sometimes". For now, we still allow opt-out via the intentionally ugly screen._default_attr_ids = nil The end goal is to get rid of all of these eventually (which will be easier as part of the color scheme migration)
* fix(terminal): don't pass incomplete UTF-8 sequence to libvterm (#27922)zeertzjq2024-03-19
|
* test(terminal/cursor_spec): unskip tests that pass on Windows (#27924)zeertzjq2024-03-19
| | | | | Also: - Make indent of test cases consistent. - Unskip TUI rapid resize test with ASAN as reflow is now disabled.
* test(terminal/buffer_spec): fix incorrect tests (#27923)zeertzjq2024-03-19
| | | | | The first describe() block enters terminal mode in before_each(), so feed_command() at the start of a test case writes it to the terminal instead of executing it.
* test: combining TermCursorNC with CursorLine/CursorColumn (#27898)zeertzjq2024-03-17
|
* refactor(drawline): integrate terminal hl with eol loop (#27893)zeertzjq2024-03-17
| | | | | | | There is no test for using 'cursorline' in Normal mode in a terminal buffer, so add a test and fix 'cursorcolumn' remaining when entering Terminal mode. Also move synIDattr() tests to ui/highlight_spec.lua.
* fix(terminal): disable reflow againChristian Clason2024-03-14
| | | | | | | reverts https://github.com/neovim/neovim/commit/c855eee919f2d4edc9b9fa91b277454290fbabfe This setting introduces constant CI failures on macos (see https://github.com/neovim/neovim/issues/23762).
* test(terminal/buffer_spec): re-skip bang test on Windowszeertzjq2024-02-26
|
* fix(process): start pty process eof timer on main thread (#27625)zeertzjq2024-02-26
|
* test: don't use minimal timeout for "intermediate" flag (#27620)zeertzjq2024-02-25
| | | | | | With "intermediate" flag, only using minimal timeout is too short and may lead to failures. Also remove the fallback timeout in screen:expect_unchanged(), as having a different fallback timeout than screen:expect() is confusing.
* fix(terminal): block input when there is pending TermRequest (#27589)zeertzjq2024-02-24
|
* test: add test for scroll wheel at right-click menu (#27409)zeertzjq2024-02-10
|
* test(tui_spec): prevent race between nvim_input and nvim_paste (#27356)zeertzjq2024-02-06
|
* fix(tui): `space_buf` overflow when clearing screen (#27352)Sean Dewar2024-02-06
| | | | | | | | | Problem: `tui->space_buf` may be smaller than the width of the TUI or widest grid, causing an overflow when calling `tui_grid_clear` if `print_spaces` is called from `clear_region` (clears the TUI's screen since #23428). Solution: resize `space_buf` to be wide enough to fit the TUI or widest grid. Didn't bother shrinking the allocation if the max widths decrease.
* test(tui): add & improve tests for terminal queries (#27219)Gregory Anders2024-01-28
| | | | | | | | | | | | | | | | | | | Problems: 1. The test case for querying truecolor support did not check which capabilities were queried 2. The test case for querying truecolor support checked `&termguicolors` in the Nvim test runner, not the child Nvim in the the embedded terminal 3. The test case for querying truecolor support did not actually respond to the XTGETTCAP requests. `'termguicolors'` is still enabled even without responding to this query because libvterm understands and responds to the DECRQSS request, but it is still good to respond to the query explicitly instead of depending on hidden libvterm behavior 4. No test case exists at all for OSC 52 Solution: Fix all of the problems listed above.
* test(tui_spec): get &background from child session directly (#27224)zeertzjq2024-01-27
|
* feat(ui): add support for OSC 8 hyperlinks (#27109)Gregory Anders2024-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extmarks can contain URLs which can then be drawn in any supporting UI. In the TUI, for example, URLs are "drawn" by emitting the OSC 8 control sequence to the TTY. On terminals which support the OSC 8 sequence this will create clickable hyperlinks. URLs are treated as inline highlights in the decoration subsystem, so are included in the `DecorSignHighlight` structure. However, unlike other inline highlights they use allocated memory which must be freed, so they set the `ext` flag in `DecorInline` so that their lifetimes are managed along with other allocated memory like virtual text. The decoration subsystem then adds the URLs as a new highlight attribute. The highlight subsystem maintains a set of unique URLs to avoid duplicating allocations for the same string. To attach a URL to an existing highlight attribute we call `hl_add_url` which finds the URL in the set (allocating and adding it if it does not exist) and sets the `url` highlight attribute to the index of the URL in the set (using an index helps keep the size of the `HlAttrs` struct small). This has the potential to lead to an increase in highlight attributes if a URL is used over a range that contains many different highlight attributes, because now each existing attribute must be combined with the URL. In practice, however, URLs typically span a range containing a single highlight (e.g. link text in Markdown), so this is likely just a pathological edge case. When a new highlight attribute is defined with a URL it is copied to all attached UIs with the `hl_attr_define` UI event. The TUI manages its own set of URLs (just like the highlight subsystem) to minimize allocations. The TUI keeps track of which URL is "active" for the cell it is printing. If no URL is active and a cell containing a URL is printed, the opening OSC 8 sequence is emitted and that URL becomes the actively tracked URL. If the cursor is moved while in the middle of a URL span, we emit the terminating OSC sequence to prevent the hyperlink from spanning multiple lines. This does not support nested hyperlinks, but that is a rare (and, frankly, bizarre) use case. If a valid use case for nested hyperlinks ever presents itself we can address that issue then.
* test: big cleanup followupLewis Russell2024-01-17
| | | | Followup to 07a7c0ec
* test: use integers for API Buffer/Window/Tabpage EXT typesLewis Russell2024-01-16
|
* fix(edit): don't go to Terminal mode when stopping Insert mode (#27033)zeertzjq2024-01-16
|
* feat(terminal): respond to OSC background and foreground request (#17197)Daniel Steinberg2024-01-15
| | | | | | | | | | | | The motivation for this update is Issue #15365, where background=light is not properly set for Nvim running from an Nvim :terminal. This can be encountered when e.g., opening a terminal to make git commits, which opens EDITOR=nvim in the nested terminal. Under the implementation of this commit, the OSC response always indicates a black or white foreground/background. While this may not reflect the actual foreground/background color, it permits 'background' to be retained for a nested Nvim instance running in the terminal emulator. The behaviour matches Vim.
* test: rename (meths, funcs) -> (api, fn)Lewis Russell2024-01-12
|
* test: normalise nvim bridge functionsLewis Russell2024-01-12
| | | | | - remove helpers.cur*meths - remove helpers.nvim
* test: typing for helpers.methsLewis Russell2024-01-12
|
* test: remove helpers.sleep()Lewis Russell2024-01-12
|
* test: do not inject vim module into global helpersLewis Russell2024-01-12
|
* fix(terminal): use terminal buffer for TermRequest autocommand (#26974)Gregory Anders2024-01-09
|
* feat(terminal): trigger TermRequest autocommand events (#22159)Ghjuvan Lacambre2024-01-09
| | | | | | | | | | This commit implements a new TermRequest autocommand event and has Neovim emit this event when children of terminal buffers emit an OSC or DCS sequence libvterm does not handle. The TermRequest autocommand event has additional data in the v:termrequest variable. Co-authored-by: Gregory Anders <greg@gpanders.com>
* fix(test/tui_spec): pass the expected NULL-sentinel to execl()James McCoy2024-01-06
| | | | | | | | | | | | Since execl() is a variadic function, it requries a NULL-terminal to indicate the end of its argument list, c.f. exec(3) > The first argument, by convention, should point to the filename > associated with the file being executed. The list of arguments *must* > be terminated by a null pointer This fixes the failure seen on aarch64 and i386, due to garbage data being considered part of the variadic arguments.
* fix(terminal): check if mouse on statusline/tabline/winbar/vsep (#26892)zeertzjq2024-01-05
|
* refactor: format test/*Justin M. Keyes2024-01-03
|
* feat(highlight): tweak default color schemeEvgeni Chasnovski2023-12-16
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Updating default color scheme produced some feedback. Solution: Address the feedback. Outline of the changes: - Colors `Grey1` and `Grey2` are made a little bit more extreme (dark - darker, light - lighter) to increase overall contrast. - `gui` colors are treated as base with `cterm` colors falling back to using 0-15 colors which come from terminal emulator. - Update highlight group definition to not include attribute definition if it is intended to staty uncolored. - Tweak some specific highlight groups. - Add a list of Neovim specific highlight groups which are now defined differently in a breaking way. - Minor tweaks in several other places related to default color scheme.
* test(nvim_open_term): don't resize after creating terminal (#26570)zeertzjq2023-12-14
| | | This makes the screen states consistently have no EOB lines.
* feat(nvim_open_term): convert LF => CRLF (#26384)Raphael2023-12-14
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Unlike termopen(), nvim_open_term() PTYs do not carriage-return the cursor on newline ("\n") input. nvim --clean :let chan_id = nvim_open_term(1, {}) :call chansend(chan_id, ["here", "are", "some", "lines"]) Actual behavior: here are some lines Expected behaviour: here are some lines Solution: Add `force_crlf` option, and enable it by default.
* fix(tui): don't forget to update cursor visibility (#26523)zeertzjq2023-12-12
|
* test: avoid repeated screen lines in expected stateszeertzjq2023-12-09
| | | | | | This is the command invoked repeatedly to make the changes: :%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g
* refactor(tui): use synchronized updates around actual buf flush (#26478)Gregory Anders2023-12-09
| | | | | | | | | | | | | Rather than writing the synchronized update begin and end sequences into the TUI's internal buffer (where it is later flushed to the TTY), write these sequences directly to the TTY before and after the TUI's internal buffer is itself flushed to the TTY. This guarantees that a synchronized update is always used when we are actually sending data to the TTY. This means we do not need to keep track of the TUI's "dirty" state (any sequences which affect the TUI state will be written in the TUI's internal buffer, which is now guaranteed to only ever be written when a synchronized update is active).
* test(tui_spec): update cursor_address test for flush start (#26464)zeertzjq2023-12-08
|
* test: fix Windows tests failures (#26461)Gregory Anders2023-12-08
|
* test: forward $VIMRUNTIME in child nvim instancesGregory Anders2023-12-07
|
* fix(terminal): never propagate $COLORTERM from outer env (#26440)zeertzjq2023-12-07
| | | | If $COLORTERM is "truecolor" but the user sets 'notermguicolors', propagating $COLORTERM to :terminal usually doesn't work well.
* test: set 'termguicolors' in outer Nvim instance (#26437)zeertzjq2023-12-07
| | | | | | | | | | Currently, the value of $COLORTERM in :terminal in tests depends on outer environment because of 'notermguicolors'. If $COLORTERM is not set in :terminal, an inner Nvim instance will try to detect 'termguicolors' support, which may interfere with tests. So set 'termguicolors' in outer Nvim instance unless $COLORTERM needs to be overridden, and unset it in inner Nvim instance when running TUI.