aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/terminal.c
Commit message (Collapse)AuthorAge
* 'inccommand': Introduce CMDPREVIEW state.Justin M. Keyes2016-11-15
| | | | | | | Command "live preview" is fundamentally a non-recursive concept ("preview of a preview" is not useful). Maintaining this as a global is less awkward and closer to what we actually want to express, vs adorning exarg_T, CommandLineState, etc.
* test/terminal: Cover race when :term shell process exits.Justin M. Keyes2016-10-12
| | | | | | References #5445 See https://github.com/neovim/neovim/pull/5445#issuecomment-252529766
* event/multiqueue.c: Rename "queue" to "multiqueue".Justin M. Keyes2016-10-02
| | | | | | | | | | | | | | `lib/queue.h` implements a basic queue. `event/queue.c` implements a specialized data structure on top of lib/queue.h; it is not a "normal" queue. Rename the specialized multi-level queue implemented in event/queue.c to "multiqueue", to avoid confusion when reading the code. Before this change one can eventually notice that "macros (uppercase symbols) are for the normal queue, lowercase operations are for the multi-level queue", but that is unnecessary friction for new developers (or existing developers just visiting this part of the codebase).
* api: make nvim[_obj]_set_var and _del_var not return the old valueBjörn Linse2016-09-15
|
* api: unify buffer numbers and window ids with handlesBjörn Linse2016-08-31
| | | | also allow handle==0 meaning curbuf/curwin/curtab
* build: initialize variable (#5194)Matt Fowles Kulukundis2016-08-19
|
* terminal: Ensure b:term_title always has a valueJosh Triplett2016-07-12
| | | | | | | | | | Factor out a helper function to set b:term_title, and call it during terminal initialization as well, to set the initial title to the term:// URL. This makes it much easier to use b:term_title in a statusline, with just `setlocal statusline=%{b:term_title}`, rather than needing an expression to handle the unset case.
* Always resize the embedded vterm properlyMarco Hinz2016-06-20
|
* *: Fix errors from new linter checksZyX2016-06-11
|
* *: Rename main loop variable from loop to main_loopZyX2016-05-30
| | | | | | | | | | | | | | | | Current name is inappropriate for the following reasons: 1. It is often masked by local `loop` variables. 2. It cannot be searched for. There are many `loop` variables where `loop` is some local variable. There are many cases when “loop” word is used in a comment. 3. It is in any case bad idea to use a generic name as a name of the global variable. Best if global has module prefix: this is why it is in `main.h`: `main_loop` both stands for “a main loop” and “a loop defined in `main.*`”. Since I have no idea how to list every occurrence of this variable method used to rename it is “remove it from globals.h, try to compile, fix errors”. Thus if some occurrence was hidden under false `#if` branch it was not replaced.
* Merge pull request #4350 from DarkDefender/term_colorJustin M. Keyes2016-05-06
|\ | | | | Fix guessing incorrect color index in terminal
| * Fix guessing incorrect color index in terminalSebastian Parborg2016-03-01
| | | | | | | | This should fix issue #2323
* | api: Replace set_var(name, NIL) with del_var(name)ZyX2016-04-18
| |
* | terminal.c: temporary fix for incorrect paste handlingBjörn Linse2016-03-31
|/
* Merge pull request #4274 from DarkDefender/patch-1Justin M. Keyes2016-02-25
|\ | | | | Adjust terminal text color if it is bold
| * Fix terminal true color bold colorsSebastian Parborg2016-02-23
| | | | | | | | Now the terminal should also correctly output true color codes
* | Merge pull request #4296 from mhinz/fix-termcloseJustin M. Keyes2016-02-21
|\ \ | | | | | | Make TermClose event return the associated buffer
| * | Make TermClose event return the associated bufferMarco Hinz2016-02-21
| |/ | | | | | | | | | | | | <abuf> from the TermClose event now returns the correct buffer number. Prior to this change it would always return the buffer number of the current buffer, which is obviously wrong in an async environment.
* / terminal_open: do not force autocmdsJustin M. Keyes2016-02-19
|/
* terminal: less babysitting of mapped_ctrl_cJustin M. Keyes2016-01-13
| | | | | process_interrupts() checks get_real_state() so we can avoid some housekeeping of mapped_ctrl_c in terminal-mode.
* vim-patch:7.4.569/573Shougo Matsushita2016-01-13
| | | | | | | | | | | | | | | | | vim-patch:7.4.569 vim-patch:7.4.573 Helped-by: @glts https://github.com/neovim/neovim/pull/2621 Problem: Having CTRL-C interrupt or not does not check the mode of the mapping. (Ingo Karkat) Solution: Use a bitmask with the map mode. (Christian Brabandt) https://github.com/vim/vim/commit/651863c94a882a97aec7968fc87a638ff78e56ff Problem: Mapping CTRL-C in Visual mode doesn't work. (Ingo Karkat) Solution: Call get_real_state() instead of using State directly. https://github.com/vim/vim/commit/5000869712f799d9ca25c0e45dc21d332edae5f4
* input: Do not set high-bit; preserve ALT modifier.Justin M. Keyes2016-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Background: Vim internally prefers to represent ALT/META chords as single-byte keys, by setting the high bit of the key byte. extract_modifiers() _discards_ the meta/alt modifier, but we need it for libvterm and libtermkey. Closes #2440 Closes #3727 Closes #2017 References #2277 References #2254 https://github.com/neovim/neovim/issues/2017#issuecomment-140423557 > We [not libtermkey] are setting the high bit for some reason https://github.com/neovim/neovim/issues/176#issuecomment-77834715 > libvtermkey requires the leading esc to parse alt/meta https://github.com/neovim/neovim/pull/3246#issuecomment-136328450 > A program could do better than the current logic on some terminals, by > asking for pure 8bit mode (S8C1T) and then immediately querying the > mode again. If the result comes back as an 8bit single-byte CSI, then > it can presume the mode setting was successful, and now the ESC prefix > byte won't be seen in multibyte sequences; only as an Alt- prefix or > a real Escape key. On such a terminal, it could therefore avoid > needing to use that waiting timeout.
* Enable focus events in cmdline and terminal modesJoe Hermaszewski2015-11-23
| | | | | | | | | | | | | This change adds switch cases for K_FOCUSGAINED and K_FOCUSLOST to the input handling functions in ex_getln.c and terminal.c. The handling is identical to what's found in edit.c (just calling apply_autocmds). If one enters cmdline-mode by feeding `:` and sends a focuslost event (by leaving the window for example) the text `<FocusLost>` will be inserted into the command line. There is similar behaviour in terminal mode. This patch corrects this behavior to fire the apropriate autocmd instead. Fixes #3714
* terminal: Refactor to use `state_enter`Thiago de Arruda2015-10-26
| | | | | | - Create `TerminalState` structure containing data used in terminal mode - Extract `terminal_execute` from `terminal_enter` and use it with `state_enter`.
* terminal: Don't store a buf_T reference in the terminal structThiago de Arruda2015-09-18
| | | | | | | Since vimscript can close buffers at any time, it is possible that a refresh_timer_cb will be called with an invalid buffer, but there's no way to detect this if only a reference is stored because the memory can be reused by the allocator. Use buf_T->handle which is guaranteed to be unique.
* terminal: Run screen refresh timer in a deferred queueThiago de Arruda2015-09-18
| | | | Close #3332
* term: Do not highlight bold text by default. #3333Enrico Ghirardi2015-09-12
| | | | | It makes more sense to let the user application terminal emulator decide how to render bold text.
* terminal: Fix use after freeThiago de Arruda2015-08-22
| | | | | Since close_cb may free the terminal structure, save the "wipe" flag before calling it.
* terminal: Only wipe buffer terminal_close wasn't calledThiago de Arruda2015-08-21
| | | | | | | After @250aca4f8938 it is possible that terminal_close will be called without invoking the close_cb(which normally destroys the terminal structure). If this happens, the terminal buffer will already be deleted so there's no need to call `bwipeout!`.
* terminal.c: Events in terminal_enter() should not free the terminaloni-link2015-08-21
| | | | | | | | | | | It is possible for a processed event in the input loop of terminal_enter() to destroy the terminal. But this is undetected by the function and it still tries to use the freed terminal. Use a reference count to delay the freeing of the terminal until terminal_enter() returns. Fixes #3112
* event: Refactor async event processingThiago de Arruda2015-08-13
| | | | | | | | | | - Improve the implementation of deferred/immediate events. - Use the new queue module to change how/when events are queued/processed by giving a private queue to each emitter. - Immediate events(which only exist to break uv_run recursion) are now represented in the `loop->fast_events` queue. - Events pushed to child queues are propagated to the event loop main queue and processed as K_EVENT keys.
* terminal: Ensure terminal buffers are flushed on exitThiago de Arruda2015-08-13
| | | | | When a terminal closed, make sure it is refreshed before the Terminal structure is freed. Also extract `refresh_terminal` from `on_refresh`.
* loop: Simplify loop.c and move some code to input.cThiago de Arruda2015-08-13
| | | | | | - Declare poll timer in Loop structure instead of a loop_poll_events local variable. - Move deferred event management to input.c
* event loop: New abstraction layer with refactored time/signal APIThiago de Arruda2015-07-17
| | | | | | | | | | - Add event loop abstraction module under src/nvim/event. The src/nvim/event/loop module replaces src/nvim/os/event - Remove direct dependency on libuv signal/timer API and use the new abstraction instead. - Replace all references to uv_default_loop() by &loop.uv, a new global variable that wraps libuv main event loop but allows the event loop functions to be reused in other contexts.
* terminal.c: Fix memory leak #2982oni-link2015-07-14
| | | | | dict_set_value() returns the replaced Object in a dictionary. Here the Object is unused and needs to be freed.
* doc: Fix some typos and trailing whitespace. #2875Lucas Hoffmann2015-06-21
|
* terminal : don't set vterm size to 0 (workaround #2732)Frederik Van Slycken2015-05-31
|
* Remove char_u: ex_docmd:do_cmdline_cmd()Michael Reed2015-05-13
|
* memory: Add `free` wrapper and refactor project to use itThiago de Arruda2015-04-13
| | | | | | We already use wrappers for allocation, the new `xfree` function is the equivalent for deallocation and provides a way to fully replace the malloc implementation used by Neovim.
* Merge pull request #2404 from Pyrohh/coverity-108870Michael Reed2015-04-11
|\ | | | | [RFC] coverity/108870: Missing break in switch
| * coverity/108870: Missing break in switchMichael Reed2015-04-10
| |
* | Remove all references to JobActivityMarco Hinz2015-04-11
|/ | | | | | | | | The JobActivity event got replaced by callback functions provided to jobstart() or termopen(). It got removed here: https://github.com/neovim/neovim/commit/6e7757ad51dfe3b2de857ff8a8688718ff6115ac
* coverity/{108271,108272,108273}: add fallthrough annotation #2362Alexey Shmalko2015-04-10
| | | | Signed-off-by: Michael Reed <m.reed@mykolab.com>
* Add new highlight groups TermCursor/TermCursorNCMarco Hinz2015-04-09
| | | | | | | These highlight groups replace the old mechanism of setting: - {g,b}:terminal_focused_cursor_highlight - {g,b}:terminal_unfocused_cursor_highlight
* Merge pull request #2346 from splinterofchaos/fix-terminalScott Prager2015-04-08
|\ | | | | [RFC] terminal: Handle loss of focus in event loop.
| * term: ensure term->buf is validScott Prager2015-04-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fallowing test (reduced), submitted by @mhinz may free term->buf, leaving the pointer dangling. ```vim let s:buf = -1 function! s:exit_handler() execute 'bdelete!' s:buf endfunction vnew let s:buf = bufnr('%') let id = termopen('sleep 1', { 'on_exit': function('s:exit_handler') }) call s:test() ``` When the buffer is known to be closing, set term->buf to NULL, and check buf_valid() in on_refresh(). Helped-by: Marco Hinz (@mhinz)
| * term: use window col offset to calculate widthScott Prager2015-04-05
| | | | | | | | fixes #2317
| * term: after <C-\>, resume normal input loopScott Prager2015-04-05
| | | | | | | | | | | | | | | | Pressing <C-\> and then a mouse click will insert the click into the terminal as if a keyboard button had been pressed. Keep track of whether the last input was <C-\> and only call terminal_send_key() if the next input is a key press.
| * terminal: Handle loss of focus in event loop.Scott Prager2015-04-05
| | | | | | | | | | | | | | | | | | | | | | | | While in a terminal and insert mode, if an event caused loss of focus, nvim would stay in the terminal event loop causing an inconsistent view of internal state and/or segfault. Remove the "term" argument from terminal_enter() as it only makes sense to call it with curbuf->terminal. Terminate the loop when switched to a different buffer. fixes #2301
* | Fix warnings: terminal.c: get_config_int(): Dead init: RI.Eliseo Martínez2015-04-07
| | | | | | | | | | | | | | | | | | | | Problem : Dead initialization @ 1119. Diagnostic : Real issue. Rationale : `obj` is immediately assigned another value through GET_CONFIG_VALUE macro. Resolution : Don't initialize. Helped-by: oni-link <knil.ino@gmail.com>