aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/shell.c
Commit message (Collapse)AuthorAge
* refactor: format files with uncrustify #15663dundargoc2021-09-14
|
* vim-patch:8.1.0989: various small code uglinessJan Edmund Lazo2021-03-29
| | | | | | | Problem: Various small code ugliness. Solution: Remove pointless NULL checks. Fix function calls. Fix typos. (Dominique Pelle, closes vim/vim#4060) https://github.com/vim/vim/commit/bdace838c67c1bd94e55e34270a8325933891466
* Removed restricted mode - Fix #11972georg3tom2020-11-11
|
* pvs/v1048: variable was assigned same valueJan Edmund Lazo2020-03-01
|
* lintJustin M. Keyes2020-02-02
|
* refactor: move various things to os/shell.cJustin M. Keyes2020-02-02
| | | | | - No code changes - Rename mch_expand_wildcards => os_expand_wildcards
* shell: "..." instead of "[...]" #11760Justin M. Keyes2020-01-25
| | | | | | 0c1be45ea0b7 changed pulse logic to output "[...]" instead of nothing. But that doesn't align with the "..." pulse which may follow it. ref #11130
* shell: improve displaying of pulse (#11130)Daniel Hahler2019-10-02
| | | | | | - output "[...]" to indicate throttling is being used, instead of just an empty line - go to beginning of line after displaying the pulse, so that following output is displayed over it
* Revisit out_data_decide_throttleDaniel Hahler2019-08-30
| | | | | | Pulse every 0.1s only. This makes `!yes` look much better (less busy).
* shell/logging: Fix E730 with verbose system({List}) #9009Justin M. Keyes2018-09-21
| | | | | | | | ref https://github.com/neovim/neovim/issues/9001#issuecomment-421843790 Steps to reproduce: :set verbose=9 :call system(['echo']) E730: using List as a String
* do_shell, do_filter: Remove "clear screen", "wait for return" callsJustin M. Keyes2018-09-12
| | | | | The output from shell commands is already handled by the messages.c/UI layer.
* Refactor: remove mb_ptr2len_len, mb_ptr2cells and mb_ptr2cells_lenZviRackover2018-08-31
| | | | Remove occurences of these macros.
* shell.c: fix scan-build NPE warning #8932Justin M. Keyes2018-08-29
|
* os/shell: use msg functions instead of screen when throttlingBjörn Linse2018-04-09
|
* os/shell: remove dead calls to screen functionsBjörn Linse2018-04-09
|
* shell: handle split-up UTF-8 sequencesBjörn Linse2018-02-10
|
* shell: support bellBjörn Linse2018-02-10
|
* lint, minor cleanupJustin M. Keyes2018-02-07
|
* shell: use msg_outtrans_len_attr for :!cmdBjörn Linse2018-02-05
| | | | fixes #7830 and #7788
* os_system(): do not set up input stream for empty string #7951Justin M. Keyes2018-02-01
| | | | | | | | | Test failure: test/functional/eval/system_spec.lua: "works with an empty string" E5677: Error writing input to shell-command: EPIPE ref https://github.com/neovim/neovim/pull/6558#issuecomment-361061035 ref #6554
* channels: generalize jobclose()Björn Linse2017-11-25
|
* channels: allow bytes sockets and stdio, and buffered bytes outputBjörn Linse2017-11-24
|
* channels: refactorBjörn Linse2017-11-24
|
* coverity/155506: null dereference (#7089)Justin M. Keyes2017-07-29
| | | | | | | | | | Coverity warning is a false positive: if rbuffer_read_ptr() returns NULL then `cnt` is zero. Revert 76ea97c809e50fccc5ca6615943ac6da1db1e030 (which caused the TSan build to hang often--possibly because of the missing ui_flush()). Instead, modify out_data_append_to_screen() to check for NULL. ref #6862
* coverity/155506: fixing "dereference null after check" (#6862)Chris Hall2017-06-19
| | | | | | | rbuffer_read_ptr may return a null if ptr == null && cnt == 0 && !out_data_decide_throttle(cnt) then we would have called out_data_append_to_screen(ptr, cnt, eof) which dereferences the null pointer.
* log: Always enable; remove DISABLE_LOGJustin M. Keyes2017-06-07
| | | | | | - Establish ERROR log level as "critical". Such errors are rare and will be valuable when users encounter unusual circumstances. - Set -DMIN_LOG_LEVEL=3 for release-type builds
* os/shell.c: temporary solution to not put ctrl chars on the screen gridBjörn Linse2017-05-10
|
* *: Add comment to all C filesZyX2017-04-19
|
* os/shell: Remove FUNC_ATTR_MALLOC from shell_build_argvZyX2017-04-15
| | | Returns an array of allocated strings.
* win: defaults: 'shellredir', 'shellxquote', 'shellxescape'Justin M. Keyes2017-04-12
|
* terminal: Support extra arguments in 'shell'. #4504Jack Bracewell2017-03-17
| | | | | | | | | | | | | Tokenize p_sh if used as default in ex_terminal(). Previously p_sh was used as the first arg in a list when calling termopen(), this would try to call an untokenized version of shell, meaning if you had an argument in 'shell': set shell=/bin/bash\ --login the command would fail. Helped-by: oni-link <knil.ino@gmail.com> Closes #3999
* process_spawn: Return status code (#6075)Justin M. Keyes2017-02-09
|
* out_data_decide_throttle(): timeout instead of hard limit.Justin M. Keyes2016-12-10
| | | | | | | Instead of managing max_visits, check the time every N visits. This avoids edge cases where max_visits is large but the chunk frequency slowed down, which would causing the "..." pulse to show for a very long time. It's more important to show output at reasonable intervals than to avoid calling os_hrtime().
* out_data_decide_throttle(): Avoid too-small final chunk.Justin M. Keyes2016-12-10
|
* os/shell: do_os_system(): Always show last chunk.Justin M. Keyes2016-12-10
| | | | | | | | | | | | | | | | | | | | | This ameliorates use-cases like: :!cat foo.txt :make where the user is interested in the last few lines of output. Try these shell-based ex-commands before/after this commit: :grep -r '' * :make :!yes :!grep -r '' * :!git grep '' :!cat foo :!echo foo :!while true; do date; done :!for i in `seq 1 20000`; do echo XXXXXXXXXX $i; done In all cases the last few lines of the command should always be shown, regardless of where throttling was triggered.
* os/shell: Throttle :! output, pulse "..." message.Justin M. Keyes2016-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | Periodically skip :! spam. This is a "cheat" that works for all UIs and greatly improves responsiveness when :! spams MB or GB of output: :!yes :!while true; do date; done :!git grep '' :grep -r '' * After ~10KB of data is seen from a single :! invocation, output will be skipped for ~1s and three dots "..." will pulse in the bottom-left. Thereafter the behavior alternates at every: * 10KB received * ~1s throttled This also avoids out-of-memory which could happen with large :! outputs. Note: This commit does not change the behavior of execute(':!foo'). execute(':!foo') returns the string ':!foo^M', it captures *only* Vim messages, *not* shell command output. Vim behaves the same way. Use system('foo') for capturing shell command output. Closes #1234 Helped-by: oni-link <knil.ino@gmail.com>
* shell_write_cb: Schedule error message. (#5670)Justin M. Keyes2016-11-26
| | | Closes #5558
* system('foo &', 'bar'): Show error, don't crash.Justin M. Keyes2016-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #3529 Closes #5241 In Vim, :echo system('cat - &', 'foo') works because for both system() and :! Vim writes input to a temp file and uses shell syntax to redirect the file to the backgrounded `cat` (get_cmd_output() .. make_filter_cmd()). In Nvim, :echo system('cat - &', 'foo') fails because we write the input directly via pipes (shell.c:do_os_system()), but (per POSIX[1]) backgrounded process input stream is redirected from /dev/null (unless overridden by shell redirection; supported only by some shells [2]), so our writes are ignored, the process exits quickly, and if we are writing data larger than the buffer size we'll see EPIPE. This still works: :%w !tee > foo1358.txt & but this does not: :%w !tee foo1358.txt & though it *should* (why doesn't it?) because we still do the temp file dance in do_bang() .. do_filter(). [1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_02 [2] http://unix.stackexchange.com/a/71218
* 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).
* doc: minor comment tweaksJustin M. Keyes2016-09-28
|
* refactor: eliminate misc2.cJustin M. Keyes2016-09-13
| | | | | | | | | | move `call_shell` to misc1.c Move some fns to state.c Move some fns to option.c Move some fns to memline.c Move `vim_chdir*` fns to file_search.c Move some fns to new module, bytes.c Move some fns to fileio.c
* shell_escape: rename; refactorJustin M. Keyes2016-09-11
| | | | | | | | - rename to shell_xescape_xquote - move to os/shell.c - disallow NULL argument - eliminate casts, nesting - test: empty shellxquote/shellxescape
* system(): Respect 'sxe' and 'sxq' #2789Zhaosheng Pan2016-09-10
| | | | Fixes #2773
* stream: set data together with callbackBjörn Linse2016-08-20
|
* Merge #4646 from oni-link/fix.issue.4569.3Justin M. Keyes2016-06-26
|\ | | | | Fix for missing output (#4569, ...)
| * shell.c: Fix missing outputoni-link2016-05-15
| | | | | | | | | | | | | | | | | | | | | | | | The whole stream buffer is now put on screen at once instead of only data up to the last newline. This has some advantages: * RBuffer cannot wrap around, so we never forget to output second half of the buffer. * Stream data is not delayed anymore, because we don't have to wait for a newline. This works by remembering the last used screen column.
* | *: 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.
* shell: Unquote &shell* options before using themZyX2016-01-11
|
* vim-patch:7.4.785Johan Klokkhammer Helsing2015-11-22
| | | | | | | | Problem: On some systems automatically adding the missing EOL causes problems. Setting 'binary' has too many side effects. Solution: Add the 'fixeol' option, default on. (Pavel Samarkin) https://github.com/vim/vim/commit/34d72d4b6c1a2b04a214d8a49b7d22c97bc7a8bc
* Windows: avoid "uv_" naming conflicts. #3225Seth Jackson2015-08-27
|