aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal
Commit message (Collapse)AuthorAge
...
* paste: implement redo (AKA dot-repeat)Justin M. Keyes2019-08-27
| | | | | | - Normal-mode redo idiom(?): prepend "i" and append ESC. - Insert-mode only needs AppendToRedobuffLit(). - Cmdline-mode: only paste the first line.
* paste: insert text "before" cursor in Insert-modeJustin M. Keyes2019-08-27
|
* API: nvim_pasteJustin M. Keyes2019-08-27
|
* paste: workaround typeahead raceJustin M. Keyes2019-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Workaround this failure: [ ERROR ] test/functional/terminal/tui_spec.lua @ 192: TUI paste: exactly 64 bytes test/functional/helpers.lua:403: retry() attempts: 478 test/functional/terminal/tui_spec.lua:201: Expected objects to be the same. Passed in: (table: 0x47cd77e8) { *[1] = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz endz' } Expected: (table: 0x47cd7830) { *[1] = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz end' } This happens because `curwin->w_cursor.col` is sometimes decremented at the end of `do_put`... because the editor is in Normal-mode instead of the expected Insert-mode. Caused by "typeahead race" (#10826): there may be queued input in the main thread not yet processed, thus the editor mode (`State` global) will be "wrong" during paste. Example: input "i" followed immediately by a paste sequence: i<start-paste>...<stop-paste> ^ "i" does not get processed in time, so the editor is in Normal-mode instead of Insert-mode while handling the paste. Attempted workarounds: - vim.api.nvim_feedkeys('','x',false) in vim._paste() - exec_normal() in tinput_wait_enqueue() - LOOP_PROCESS_EVENTS(&main_loop,…,0) in tinput_wait_enqueue() ref #10826
* API: nvim_put: always PUT_CURSENDJustin M. Keyes2019-08-27
| | | | | | | | | Fixes strange behavior where sometimes the buffer contents of a series of paste chunks (vim._paste) would be out-of-order. Now the tui_spec.lua screen-tests are much more reliable. But they still sometimes fail because of off-by-one cursor (caused by "typeahead race" resulting in wrong mode; fixed later in this patch-series).
* test/tui_spec: connect to child sessionJustin M. Keyes2019-08-27
|
* paste: edge-case: handle EOL at end-of-bufferJustin M. Keyes2019-08-27
| | | | This is "readfile()-style", see also ":help channel-lines".
* paste: testJustin M. Keyes2019-08-27
|
* paste: use nvim_put()Justin M. Keyes2019-08-27
|
* paste: fixup testsJustin M. Keyes2019-08-27
|
* TUI/paste: always flush on paste mode-changeJustin M. Keyes2019-08-27
| | | | | | Flush input before entering, not only when leaving, paste mode. Else there could be pending input which will erroneously be sent to the paste handler.
* paste: WIP #4448Justin M. Keyes2019-08-27
|
* tests: win: enable buffer focus testJan Edmund Lazo2019-08-18
|
* test: win: enable WinEnter terminal testJan Edmund Lazo2019-08-18
|
* tests: make TERM=interix test pending (#10576)Daniel Hahler2019-07-22
| | | | Ref: https://github.com/neovim/neovim/issues/10179 Ref: https://github.com/neovim/neovim/pull/9494
* tests: shell-test: use count for REP (#10514)Daniel Hahler2019-07-16
| | | | | | | Also fix V576: use width specification > Incorrect format. Consider checking the third actual argument of the > 'sscanf' function. It's dangerous to use string specifier without width > specification. Buffer overflow is possible.
* tests: ex_terminal_spec: add test for previous leak (#10450)Daniel Hahler2019-07-08
| | | Closes https://github.com/neovim/neovim/pull/4766.
* tests: fix/improve "TUI background color" tests (#10229)Daniel Hahler2019-07-03
| | | | - Ensure the opposite of the expected bg is active. - Improves performance: 1.2s instead of 4.5s.
* tests: fix flaky "terminal (with fake shell) with not arguments …" (#10401)Daniel Hahler2019-07-02
| | | | | | `retry()` would only try it three times (waiting for 20ms in between), despite the large timeout. Fixes https://github.com/neovim/neovim/issues/10265.
* getchar: Handle incomplete <Paste> in typeahead buffer #10311Alan Wu2019-06-24
| | | | | | | | | | | | <Paste> is a 3-byte sequence and the beginning one or two bytes can appear at the very end of the typeahead buffer. When this happens, we were exiting from `vgetorpeek()` instead of reading more characters to see the complete sequence. I think this should fix #7994 -- at least partially. Before this change, when I paste exactly 64 characters into a freshly booted instance, I get what I pasted plus the literal text "<Paste>" at the end. Nvim also stays in nopaste mode. The attached test case fails in this manner without the code change. Fix #7994
* 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
* test: remove use of require('test.helpers')Justin M. Keyes2019-05-18
| | | | | | The test.functional.helpers and test.unit.helpers modules now include all of the public functions from test.helpers, so there is no need to separately require('test.helpers').
* Merge pull request #9883 from bfredl/termredrawBjörn Linse2019-05-14
|\ | | | | make terminal state redraw like any other state
| * ui/terminal: make terminal state redraw like any other stateBjörn Linse2019-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, ordinary redraws were missing from terminal mode. Instead, there was an async callback that invoked update_screen() on terminal data regardless of mode (as if :redraw! was invoked by a timer). This created some issues: - async changes to an unrelated ordinary buffer were not always redrawn in terminal mode - screen cursor position was not properly updated in terminal mode (partial fix, will be properly fixed in a follow up PR) - ad-hoc logic was needed for interaction with special states such as inccommand or horizontal wildmenu. Instead redraw terminal mode just like any other state. This disables forced redraws in cmdline mode, which were inconisent which async changes to normal buffers (which are not redrawn in cmdline mode).
* | UI/nvim_ui_attach(): add `override` optionJustin M. Keyes2019-05-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before now, Nvim always degrades UI capabilities to the lowest-common denominator. For example, if any connected UI has `ext_messages=false` then `ext_messages=true` requested by any other connected UI is ignored. Now `nvim_ui_attach()` supports `override=true`, which flips the behavior: if any UI requests an `ext_*` UI capability then the capability is enabled (and the legacy behavior is disabled). Legacy UIs will be broken while a `override=true` UI is connected, but it's useful for debugging: you can type into the TUI and observe the UI events from another connected (UI) client. And the legacy UI will "recover" after the `override=true` UI disconnects. Example using pynvim: >>> n.ui_attach(2048, 2048, rgb=True, override=True, ext_multigrid=True, ext_messages=True, ext_popupmenu=True) >>> while True: n.next_message();
* | terminal: swap priority of terminal, editor highlightsJustin M. Keyes2019-05-02
| | | | | | | | closes #9964
* | Reset stop_insert_mode in terminal_enter rather than terminal_checkglacambre2019-04-20
|/ | | | | | | | | | | Problem: Using `:stopinsert` while in normal mode in a terminal buffer prevents neovim from entering insert mode. Solution: Move `stop_insert_mode = false` from terminal_check to terminal_enter to be consistent with edit.c, as suggested by bfredl in #9889. Closes https://github.com/neovim/neovim/issues/9889.
* :stopinsert should leave terminal-mode #9856glacambre2019-04-08
| | | | | | | | | Problem: Calling :stopinsert from RPC while in terminal-mode does not go back to normal-mode. Solution: Implement a check() handler for state_enter(), adapted from insert_check(). Fix #7807
* test: simplify TUI bg-detection testJustin M. Keyes2019-03-15
| | | | | | | Previous approach skipped the test if the expected value matched the default value ("dark"). New approach always checks, but uses retry() to ignore potentially wrong 'background' before the terminal response is handled.
* 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
* vim-patch:8.1.0994: fix relative cursor position #9676Justin M. Keyes2019-03-09
| | | | | | Problem: Relative cursor position is not calculated correctly. Solution: Always set topline, also when window is one line only. (Robert Webb) Add more info to getwininfo() for testing. https://github.com/vim/vim/commit/8fcb60f961bdd134599fb016c6537fd496e800f5
* 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
| |\
| | * Add tests for terminal background detectionJosh Triplett2016-07-24
| | |
* | | terminal: Fix potential invalid local 'scrollback' (#9605)Justin M. Keyes2019-02-17
| | | | | | | | | | | | | | | | | | TermOpen autocmd may set local 'scrollback' to -1, this needs to be adjusted as in on_scrollback_option_changed(). fixes #9588 (OOM, out of memory)
* | | UI: always use contrete colors for default_colors_setBjörn Linse2019-02-05
| | | | | | | | | | | | | | | But add an escape hatch needed for external TUI, so it still can use terminal emulator defaults.
* | | options: set 'scrollback' to -1 by default #9563Marco Hinz2019-02-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | Makes the 'scrollback' option more consistent (same default for all buffers) and future-proof. - Default to -1 for all buffers, but treat it as an implementation detail. - Document range of 1 - 100_000. - New terminal buffer by default sets scrollback=10_000 if the global default is -1. - Existing terminal buffer: On entering terminal-mode or on refresh, if the user explicitly did `:set[local] scbk=-1`, the local value goes to 100_000 (max). (This is undocumented on purpose. Users should work with explicit values in the range of 1-100_000.)
* | | test: improve reliability of ":terminal topline" testJustin M. Keyes2019-01-31
| | | | | | | | | | | | | | | | | | - Avoid using platform-specific shell, it failed in MINGW_64 env. - tty-test.c echos our input, which is exactly what we need for this test. - Test fails correctly if 894f6bee54e8 is reverted.
* | | :terminal : set topline based on window height #8325Andrew Pyatkov2019-01-29
| | | | | | | | | | | | | | | closes #8324 closes #8556
* | | terminal: handle size when switching buffers in windowBjörn Linse2019-01-27
| | |
* | | window/ui: reorganize size variables, fix terminal window size with multigrid.Björn Linse2019-01-27
|/ / | | | | | | | | | | | | wp->w_height_inner now contains the "inner" size, regardless if the window has been drawn yet or not. It should be used instead of wp->w_grid.Rows, for stuff that is not directly related to accessing the allocated grid memory, such like cursor movement and terminal size
* | multigrid: add multigrid screen testsUtkarsh Maheshwari2018-12-31
| |
* | multigrid: add multigrid support to test infrastructureBjörn Linse2018-12-31
| | | | | | | | make Screen explicitly tied to its session
* | test: win/TUI builtin terminfosJustin M. Keyes2018-12-28
| |
* | highlight: Fix missing .rgb_sp_color in initializers (#9287)Justin M. Keyes2018-11-30
| | | | | | | | | | | | | | terminal_get_line_attributes() had this bug for a long time, though it likely had no effect visible to users. ref #9028 ref 60f845ca55a1
* | defaults: background=dark #2894 (#9205)Justin M. Keyes2018-11-20
| | | | | | | | | | | | | | | | | | | | | | | | | | By historical accident, Nvim defaults to background=light. So on a dark background, `:colorscheme default` looks completely wrong. The "smart" logic that Vim uses is confusing for anyone who uses Vim on multiple platforms, so rather than mimic that, pick the (hopefully) most common default. - Since Neovim is dark-powered, we assume most users have dark backgrounds. - Most of the GUIs tend to have a dark background by default. ref #6289
* | test: adjust time-sensitive tests (#9220)Justin M. Keyes2018-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | | - window_split_tab_spec.lua: Put cursor at bottom of :terminal buffer so that it follows output. - inccommand_spec.lua: Increase timeout to allow 2nd retry. - Timer tests are less reliable on Travis CI macOS 10.12/10.13. ref #6829 ref e39dade80b02 ref de13113dc16e ref https://github.com/neovim/neovim/pull/9095#issuecomment-429603452 > We don't guarantee that a X ms timer is triggered during Y ms sleep > for any X<Y, though I would expect the load to be really bad for this > to happen with X=10ms, Y=40ms.
* | test/win: window_split_tab_spec: fix retry()Justin M. Keyes2018-11-05
| |