aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
Commit message (Collapse)AuthorAge
* tui: check stty/termios for kbsJustin M. Keyes2016-12-23
| | | | | | | | | | | Requires libtermkey 0.19+ Closes #2048 Closes #5693 See https://github.com/neovim/libtermkey/compare/a9b61424aae9f7548162ff112393c5f706cf54f1%5E...c0eb4e4a05f49ad8fee0195c77f2c29d09cc36af See https://bugzilla.redhat.com/show_bug.cgi?id=142659 See https://github.com/tmux/tmux/blob/fe4e9470bb504357d073320f5d305b22663ee3fd/tty-keys.c#L625-L632
* 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
* os_nodetype: open fd with O_NONBLOCK (#5515)Justin M. Keyes2016-10-21
| | | | | Closes #5267 Helped-by: oni-link <knil.ino@gmail.com>
* 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
* signal_init: unblock all signals on startup. #5283Nicolas Hillegeer2016-09-03
| | | | | | | As discussed on #5243 and #5283. Helped-by: John Szakmeister <john@szakmeister.net> Helped-by: Justin M. Keyes <justinkz@gmail.com>
* signal_init: Always unblock SIGCHLD. (#5243)Justin M. Keyes2016-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inherited signal mask may block SIGCHLD, which causes libuv to hang at epoll_wait. Closes #5230 Helped-by: Nicolas Hillegeer <nicolas@hillegeer.com> Helped-by: John Szakmeister <john@szakmeister.net> Note: the #pragma gymnastics are a workaround for broken system headers on macOS. signal.h: int sigaddset(sigset_t *, int); #define sigaddset(set, signo) (*(set) |= __sigbits(signo), 0) sys/_types/_sigset.h: typedef __darwin_sigset_t sigset_t; sys/_types.h: typedef __uint32_t __darwin_sigset_t; /* [???] signal set */ sigset_t is defined as unsigned int, but the sigaddset() ORs it with an int, mixing the types. So GCC generates a sign-conversion warning: sig.c:9:13: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion] (*(&s) |= __sigbits((sigset_t) 20), 0); ~~ ^~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. System headers are normally ignored when the compiler generates warnings: https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html > GCC gives code found in system headers special treatment. All warnings, > other than those generated by ‘#warning’ (see Diagnostics), are suppressed > while GCC is processing a system header. Macros defined in a system header > are immune to a few warnings wherever they are expanded. This immunity is > granted on an ad-hoc basis, when we find that a warning generates lots of > false positives because of code in macros defined in system headers. Instead of the #pragma workaround, we could cast the sigset_t pointer: # if defined(__APPLE__) sigaddset((int *)&mask, SIGCHLD); # else sigaddset(&mask, SIGCHLD); # endif but that could break if the headers are later fixed.
* stream: set data together with callbackBjörn Linse2016-08-20
|
* Merge #5025 'input.c: Restore double click'Justin M. Keyes2016-08-07
|\
| * lintsach1t2016-08-07
| |
| * input.c: restore double clicksach1t2016-08-07
| |
* | Merge #5130 from equalsraf/tb-appveyorJustin M. Keyes2016-08-07
|\ \ | |/ |/| Enable MSYS/MinGW builds in Appveyor
| * Create os_translate_sys_error()Rui Abreu Ferreira2016-08-07
| | | | | | | | | | | | Wrap up uv_translate_sys_error and fallbacks into a new function os_translate_sys_error(). In windows a copy of the original uv_translate_sys_error() was imported from libuv.
* | Merge #4964 from ZyX-I/no-xdg-expandJustin M. Keyes2016-08-04
|\ \ | |/ |/| option: Do not expand options, obtained from XDG vars
| * option: Also escape commas in options other then &runtimepathZyX2016-07-10
| |
* | os_resolve_shortcut: Report conversion error.Justin M. Keyes2016-07-30
| |
* | mbyte.c: Move utf8/utf16 functions to mbyte.cJustin M. Keyes2016-07-30
| |
* | utf16_to_utf8Justin M. Keyes2016-07-30
| |
* | os_resolve_shortcut: cleanupJustin M. Keyes2016-07-30
| |
* | os_resolve_shortcut: Remove legacy win16 codepath.Justin M. Keyes2016-07-30
| |
* | utf8_to_utf16: adapt libuv's fs__capture_pathJustin M. Keyes2016-07-30
| |
* | os_resolve_shortcut: initial port from Vim sourceJustin M. Keyes2016-07-30
| |
* | Remove redundant includes of unistd.h (#5126)Rui Abreu Ferreira2016-07-29
|/
* os/fs: Rename os_file_exists to os_path_exists (#4973)Daniel Xu2016-07-06
| | | | Because the old name did not indicate that the function would return true on directories as well.
* 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.
* | Merge #4965 from justinmk/fixup4453Justin M. Keyes2016-06-25
|\ \ | | | | | | ex_cmds2.c: lint
| * | ex_cmds2.c: cleanupJustin M. Keyes2016-06-25
| | |
* | | os/fileio: Use readv oftenZyX2016-06-24
| | |
* | | *: Satisfy linter (newest type casts rule)ZyX2016-06-24
| | |
* | | file: Move src/nvim/file.* to src/nvim/os/fileio.*ZyX2016-06-24
| | |
* | | file: Add buffered reading and writingZyX2016-06-23
| | | | | | | | | | | | Still no busted tests. Not tested without HAVE_PREADV.
* | | file,os/fs,shada: Separate opening, closing, writing and reading filesZyX2016-06-23
|/ / | | | | | | | | | | | | | | Moves low-level functions handling to os/fs.c. Adds file.c with a proxy interface. Target: while leaving syscalls handling is os.c (partially handled by libuv), add buffering for reading and writing to file.c.
* | Remove some unnecessary function attributes (#4909)oni-link2016-06-11
| | | | | | | | This removes attribute FUNC_ATTR_NONNULL_ALL for functions without a pointer parameter.
* | eval: allow setting cwd in {jobstart,termopen}()Aleksa Sarai2016-06-07
| | | | | | | | | | | | | | | | | | | | | | Processes in vim are always started in the current directory, which causes issues when the process is a daemon and the current directory is a mountpoint. Fix this by adding an option to set the cwd of the new process with jobstart(). In addition, fix termopen() so that it actually uses the cwd option from the dict (it couldn't previously set the cwd value due to dead code). Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
* | pty_process: split into plat-specific files (#3976)Rui Abreu Ferreira2016-06-04
| |
* | *: 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.
* | os_nodetype: Return NODE_NORMAL if os_stat fails.Justin M. Keyes2016-05-22
| | | | | | | | | | | | | | | | Conforms to Vim's mch_nodetype. Regression by 7db4a15. buf_write() expects NODE_WRITABLE for character devices such as /dev/stderr. Closes #4772
* | os/env.c: document remove_tail() properlyFelipe Oliveira Carvalho2016-05-15
| |
* | os/env.c: declare srcp and dst as restrict in expand_env_esc()Felipe Oliveira Carvalho2016-05-15
| | | | | | | | | | | | | | | | | | | | | | ...and small refactorings: - Style changes - Variable renames - Changes in variable scope This change won't bring new problems (undefined behavior) as `memcpy` is already being used in the function.
* | os/env.c: cosmetic changes done during review of the fileFelipe Oliveira Carvalho2016-05-15
|/
* vim-patch:7.4.896Rui Abreu Ferreira2016-05-08
| | | | | | | | | Problem: Editing a URL, which netrw should handle, doesn't work. Solution: Avoid changing slashes to backslashes. (Yasuhiro Matsumoto) https://github.com/vim/vim/commit/b4f6a46b01ed00b642a2271e9d1559e51ab0f2c4 Cherry-picked from https://github.com/neovim/neovim/pull/810, rebased.