summaryrefslogtreecommitdiffstatshomepage
path: root/test/functional/terminal/scrollback_spec.lua
AgeCommit message (Collapse)AuthorFiles
2026-03-10feat(terminal): surface exit code via virttext + nvim_get_chan_info #37987Ayaan1
Problem: When a terminal process exits, "[Process Exited]" text is added to the buffer contents. Solution: - Return `exitcode` field from `nvim_get_chan_info`. - Show it in the default 'statusline'. - Show exitcode as virtual text in the terminal buffer.
2026-02-23test(terminal/scrollback_spec): fix flaky test (#38026)zeertzjq1
When using feed_data() with hidden buffer, terminal refresh may arrive during may_restore_curbuf(), causing "last cursor" positions to change. Get the two "last cursor" positions in the same RPC call.
2026-02-18test: fix test failure causing following tests to fail (#37932)zeertzjq1
2026-02-17fix(terminal): crash after deleting buffer lines (#37921)zeertzjq1
Problem: Terminal crashes after deleting buffer lines. Solution: Don't insert lines above lines 0.
2026-02-13fix(terminal): scrollback may still be wrong on height increase (#37835)zeertzjq1
Problem: Terminal scrollback may be wrong when increasing height after outputting lines with full scrollback. Solution: Ensure enough number of scrollback lines have been deleted.
2026-02-12fix(terminal): changing height may lead to wrong scrollback (#37824)zeertzjq1
Problem: Changing terminal height immediately after outputting lines may lead to wrong scrollback. Solution: Insert pending scrollback lines before the old window height.
2026-02-10fix(terminal): wrong scrollback with nvim_open_term() on buffer (#37791)zeertzjq1
Problem: Wrong scrollback when passing a buffer with many lines to nvim_open_term(). Solution: Delete all buffer lines before opening the terminal. I tried to use buf_clear(), but it crashes inside deleted_lines_mark(), so I'll just use deleted_lines_buf() for now. The behavior of marks can be decided later.
2026-02-09fix(terminal): handle ED 3 (clear scrollback) properly (#21412)zeertzjq1
Problem: Terminal doesn't handle ED 3 (clear scrollback) properly. Solution: Add vterm callback for sb_clear(). Also fix another problem that scrollback lines may be duplicated when pushing to scrollback immediately after reducing window height, as can be seen in the changes to test/functional/terminal/window_spec.lua.
2025-10-29fix(terminal): keep last cursor if it's on the last rowzeertzjq1
2025-10-25fix(terminal): adjust marks when deleting scrollback lines (#36294)zeertzjq1
This also fixes inconsistent scrolling behavior on terminal output when cursor is in the middle of the buffer and the scrollback is full.
2025-07-16test(tui_spec): flakiness, global highlight definitions #34958luukvbaal1
2025-07-14feat(term): increase max scrollback to 1000000Lewis Russell1
Problem: Cannot use `nvim_open_term()` to pipe terminal scrollback > 100000 Solution: Increase scrollback limit to 1000000 If there's no technical consequences of doing this, can be set even higher in the future.
2024-12-19feat(jobs): jobstart(…,{term=true}), deprecate termopen() #31343Justin M. Keyes1
Problem: `termopen` has long been a superficial wrapper around `jobstart`, and has no real purpose. Also, `vim.system` and `nvim_open_term` presumably will replace all features of `jobstart` and `termopen`, so centralizing the logic will help with that. Solution: - Introduce `eval/deprecated.c`, where all deprecated eval funcs will live. - Introduce "term" flag of `jobstart`. - Deprecate `termopen`.
2024-12-17feat(terminal)!: cursor shape and blink (#31562)Gregory Anders1
When a terminal application running inside the terminal emulator sets the cursor shape or blink status of the cursor, update the cursor in the parent terminal to match. This removes the "virtual cursor" that has been in use by the terminal emulator since the beginning. The original rationale for using the virtual cursor was to avoid having to support additional UI methods to change the cursor color for other (non-TUI) UIs, instead relying on the TermCursor and TermCursorNC highlight groups. The TermCursor highlight group is now used in the default 'guicursor' value, which has a new entry for Terminal mode. However, the TermCursorNC highlight group is no longer supported: since terminal windows now use the real cursor, when the window is not focused there is no cursor displayed in the window at all, so there is nothing to highlight. Users can still use the StatusLineTermNC highlight group to differentiate non-focused terminal windows. BREAKING CHANGE: The TermCursorNC highlight group is no longer supported.
2024-11-14fix(tests): needing two calls to setup a screen is cringebfredl1
Before calling "attach" a screen object is just a dummy container for (row, col) values whose purpose is to be sent as part of the "attach" function call anyway. Just create the screen in an attached state directly. Keep the complete (row, col, options) config together. It is still completely valid to later detach and re-attach as needed, including to another session.
2024-09-15refactor(tests): rename terminal/testutil.lua => testterm.lua #30372Justin M. Keyes1
This module is generally used by any tests that need the full Nvim TUI instead of `screen.lua`. Thus it should live in `functional/` instead of in `functional/terminal/`.
2024-04-23test: improve test conventionsdundargoc1
Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
2024-04-10refactor(test): inject after_each differentlyLewis Russell1
2024-04-08test: improve test conventionsdundargoc1
Work on https://github.com/neovim/neovim/issues/27004.
2024-03-23refactor(tests): all screen tests should use highlightsbfredl1
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)
2024-01-12test: rename (meths, funcs) -> (api, fn)Lewis Russell1
2024-01-12test: normalise nvim bridge functionsLewis Russell1
- remove helpers.cur*meths - remove helpers.nvim
2024-01-12test: typing for helpers.methsLewis Russell1
2024-01-03refactor: format test/*Justin M. Keyes1
2023-12-14feat(nvim_open_term): convert LF => CRLF (#26384)Raphael1
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.
2023-12-09test: avoid repeated screen lines in expected stateszeertzjq1
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
2023-12-07test(terminal): remove unnecessary string operations (#26434)zeertzjq1
2023-11-30test: unskip more terminal tests on Windows (#26315)zeertzjq1
2023-09-24test: only trim trailing spaces in swapfile tests (#25341)zeertzjq1
2023-08-14test(terminal): fix scrollback test flakiness (#24708)zeertzjq1
Problem: Terminal scrollback test is flaky. Solution: Use INTERACT flag so the job doesn't exit immediately.
2023-08-10test: update tests for auto-closing :term buffersGregory Anders1
The terminal buffer closes automatically when using `:terminal` and the command exits without an error. This messes up some tests that expect the terminal buffer to still be open. We can force the buffer not to close by passing an argument to `:terminal`. This can be anything, since the shell-test stub simply prints whatever argument it's given.
2023-07-23test: reduce flakiness (#24443)zeertzjq1
Avoid consecutive RPC requests involving :startinsert or :stopinsert, because consecutive RPC requests may be processed together, before the :startinsert or :stopinsert takes effect. Also change some feed_command() to command() to make tests faster.
2023-05-22test: don't unnecessarily specify win/buf for `nvim_(get|set)_option_value`Famiu Haque1
`nvim_(get|set)_option_value` pick the current buffer / window by default for buffer-local/window-local (but not global-local) options. So specifying `buf = 0` or `win = 0` in opts is unnecessary for those options. This PR removes those to reduce code clutter.
2023-05-21refactor(options): deprecate nvim[_buf|_win]_[gs]et_optionLewis Russell1
Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: famiu <famiuhaque@protonmail.com>
2023-04-05refactor: rename local API alias from a to apiLewis Russell1
Problem: Codebase inconsistently binds vim.api onto a or api. Solution: Use api everywhere. a as an identifier is too short to have at the module level.
2023-03-13test: unskip working Windows tests (#22537)dundargoc1
Some tests that were previously not working have started to work again for unspecified reasons, so let's enable them.
2022-11-22test: simplify platform detection (#21020)dundargoc1
Extend the capabilities of is_os to detect more platforms such as freebsd and openbsd. Also remove `iswin()` helper function as it can be replaced by `is_os("win")`.
2022-11-13test: introduce skip() #21010dundargoc1
This is essentially a convenience wrapper around the `pending()` function, similar to `skip_fragile()` but more general-purpose. Also remove `pending_win32` function as it can be replaced by `skip(iswin())`.
2022-06-25refactor(tests): introduce testprg()Justin M. Keyes1
Also: - Add a describe('shell :!') section to system_spec. - Make the test for #16271 work on systems without powershell.
2022-06-08fix(terminal): scrollback delete lines immediately #18832Javier Lopez1
* on_scrollback_option_changed renamed to adjust_scrollback. The function name did not correspond to what it was doing. It is called unconditionally in every refresh of the terminal unrelated if the scrollback option was changed. * new on_scrollback_option_changed function, which calls refresh_terminal, which then calls adjust_scrollback * terminal_check_size is not the appropriate function to call when the option is changed since it only conditionally adjusts the scrollback. Use the new on_scrollback_option_changed fixes #15477 fixes #11811
2022-05-18test: unskip tests on Windows (#18600)zeertzjq1
Remove the command('qall!') from mksession_spec.lua because it prevents helpers.rmdir() from retrying. Allow extra trailing spaces when matching terminal lines.
2022-02-20ci: skip tests that fail on windowsDundar Göc1
2021-12-15fix(terminal): fix resize crash with pending scrollback (#14891)Sean Dewar1
refresh_scrollback assumes pending scrollback rows exist only if the terminal window height decreased (or the screen was full). However, after accumulating scrollback, it's possible in some cases for the terminal height to increase before refresh_scrollback is called via invalidation (especially when the terminal buffer isn't initially displayed in a window before nvim_open_term), which may crash. As we'll have enough room for some scrollback rows, just append them to the top of the buffer until it fills the window, then continue with the previous logic for any remaining scrollback rows if necessary.
2020-12-01test/wildmode_spec: override $PS1Jan Edmund Lazo1
User config may set $PS1 for a colored prompt. It breaks the screen tests.
2020-10-19A Mudholland Dr. RecastBjörn Linse1
The commit summary maybe does not make sense, but calling a function that does not wait on anything `wait()` makes even less sense.
2019-11-09test/Screen:expect: replace "{IGNORE}" with "{MATCH:…}"Justin M. Keyes1
ref #11004
2019-10-13tests/ui: remove unnecessary screen:detach()Björn Linse1
It is perfectly fine and expected to detach from the screen just by the UI disconnecting from nvim or exiting nvim. Just keep detach() in screen_basic_spec, to get some coverage of the detach method itself. This avoids hang on failure in many situations (though one could argue that detach() should be "fast", or at least "as fast as resize", which works in press-return already). Never use detach() just to change the size of the screen, try_resize() method exists for that specifically.
2019-09-16tests: fix flaky 'scrollback' option deletes lines (only) if necessary (#11003)Daniel Hahler1
Using `screen:expect` with the complete grid appears to fix its flakiness. Fixes https://github.com/neovim/neovim/issues/10723.
2019-09-06test: Eliminate expect_errJustin M. Keyes1
Eliminate `expect_err` in favor of `pcall_err` + `eq` or `matches`.
2019-09-04tests: scrollback_spec: use shell-test instead of awk (#10914)Daniel Hahler1
Ref: #10804 Ref: b64af88