aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
Commit message (Collapse)AuthorAge
* 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
* Merge #7863 'mingw64: fix gcc warnings'Justin M. Keyes2018-01-20
|\
| * Fix warning: multi-line comment [-Wcomment] use `:341,355s/: ↵George Zhao2018-01-19
| | | | | | | | \zs.*/\=string(submatch(0))`
| * Fix warning, read/write have unsigned int count on windows.George Zhao2018-01-19
| |
| * Fix warning about NULL compareGeorge Zhao2018-01-18
| |
| * Fix warning about conversion on mingw64George Zhao2018-01-18
|/
* os/input.c: parse keycodes in non-string context #7411lePerdu2018-01-18
| | | | | | | | | | | cb02137dfac7 had two mistakes, of the same nature: trans_special() must be invoked with in_string=false unless the parsing context is a VimL string. replace_termcodes() and input_enqueue() are low-level mechanisms where VimL strings do not exist. keymap.c: adjust double-quote case to satisfy keymap_spec.lua closes #7410
* os/fileio: Fix some flag names in file_* functions documentationZyX2018-01-14
|
* vim-patch:8.0.0074Michael Schupikov2017-12-15
| | | | | | | | | | Problem: Cannot make Vim fail on an internal error. Solution: Add IEMSG() and IEMSG2(). (Domenique Pelle) Avoid reporting an internal error without mentioning where. https://github.com/vim/vim/commit/95f096030ed1a8afea028f2ea295d6f6a70f466f Signed-off-by: Michael Schupikov <michael@schupikov.de>
* pty_process_unix: _exit() on execvp() failureJustin M. Keyes2017-12-13
| | | | | Mostly cargo-culting based on a reading of the manpages, interwebs, and the Vim source.
* mac: Set $LANG based on the system localeJames McCoy2017-12-10
| | | | | | | | | Unix's typical locale-related environment variables aren't always set appropriately on a Mac. Instead of relying on them, query the locale information using Mac specific APIs and then set $LANG appropriately for the rest of nvim. Closes #5873
* Use defined(BSD) check when defining OPEN_CHR_FILESJames McCoy2017-11-28
| | | | | | | | | | | | | | | | Rather than enumerate predefines for all BSD systems, just rely on the fact that they all "#define BSD" in sys/param.h. Debian's GNU/kFreeBSD still requires its own check, since it isn't using the BSD userspace. References: OpenBSD - https://github.com/openbsd/src/blob/210ebf9df0460bbdad02da9bbd5d859b61f57462/sys/sys/param.h#L40 FreeBSD - https://github.com/freebsd/freebsd/blob/f5d95e1f8d32db4ccccfd5ad9cecb21ed07a695d/sys/sys/param.h#L43 NetBSD - https://github.com/NetBSD/src/blob/ea620980793cf2011e5424f4a537b0488e3ffb4d/sys/sys/param.h#L49 DragonFlyBSD - https://github.com/DragonFlyBSD/DragonFlyBSD/blob/94ecf1295bb42b59772448d58ff40dd75c4a3ef8/sys/sys/param.h#L41 vim-patch:8.0.1357
* input: only change mode of input fd if there is an input fdBjörn Linse2017-11-25
|
* tui: job-control: use saved termios for pty jobsJustin M. Keyes2017-11-25
| | | | | | | | | | | | | | On startup, if running in a terminal, save the termios properties. Use the saved termios for `:terminal` and `jobstart()` pty jobs. This won't affect nvim spawned outside of a terminal. questions: - This affects `:terminal` and `jobstart({'pty':v:true})`. Should we be more conservative for `jobstart({'pty':v:true})` (e.g. pass NULL to forkpty() and let the OS defaults prevail)? - Note: `iutf8` would not be set in that case.
* 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
|
* os_nodetype: reworkJustin M. Keyes2017-11-17
| | | | | | | | | | | | Make the Windows impl closer to Vim os_win32.c, and the Unix impl closer to Vim os_unix.c. Outcomes: - Do not send negative fd to close(). ref #4806 #4772 #6860 - Fallback return-value is now correct in (hopefully) all cases. - unix: check S_ISXXX instead of relying on os_open (which can fail for irrelevant reasons). buf_write() expects NODE_WRITABLE for character devices such as /dev/stderr. 96f834a8424e
* os_open, os_stat: UV_EINVAL on NULL filenameJustin M. Keyes2017-11-17
| | | | | | | | | | | | | EINVAL (instead of EFAULT) because that's what glibc does: https://github.com/bminor/glibc/blob/master/io/open.c#L35 os_nodetype: check for UV_EINVAL explicitly. ref #4370 ref https://github.com/neovim/neovim/issues/4370#issuecomment-344366571 ref ac055d677aa9eff9fca11cecb5ac7f7a4edb0265 ref #4772
* pty_process_win: avoid quoting for cmd.exeerw72017-08-16
|
* win/pty: log errorserw72017-08-16
|
* win/pyt: cleanuperw72017-08-16
|
* win/pty: quote_cmd_arg(): check boundserw72017-08-16
|
* win/pty: jobstart, jobstop: fix null-pointer dereferenceerw72017-08-16
| | | | | | | - Make sure that proc->in is not NULL, because nvim crashed when starting a job with pty. - Make sure that proc->out is not NULL, because nvim crashed when stopping a job opened with pty.
* win: support :terminalerw72017-08-16
|
* win: integrate winpty (WIP)Ryan Prichard2017-08-16
| | | | | | | | | | | | | | Handling of process exit is still broken. It detects the moment when the child process exits, then quickly stops polling for process output. It should continue polling for output until the agent has scraped all of the process' output. This problem is easy to notice by running a command like "dir && exit", but even typing "exit<ENTER>" can manifest the problem -- the "t" might not appear. winpty's Cygwin adapter handles shutdown by waiting for the agent to close the CONOUT pipe, which it does after it has scraped the child's last output. AFAIK, neovim doesn't do anything interesting when winpty closes the CONOUT pipe.
* io: more guards against NULL filename (#7159)Justin M. Keyes2017-08-13
| | | | References ac055d677aa9 References #4370
* os_stat: return ENOENT on NULL filename argJames McCoy2017-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #4370 Explication: In the backtrace in #4370, we see that `buf_write()` was called with non-NULL `fname` and `sfname` arguments, but they've since _become_ NULL. #7 0x00000000004de09d in buf_write (buf=0x1dee040, fname=0x0, fname@entry=0x1e985b0 "/home/sean/src/github.com/snczl/virta/pkg/meld/segment.go", sfname=0x0, sfname@entry=0x1ddfa60 "segment.go", start=1, end=72, eap=eap@entry=0x7ffc6b032e60, append=0, forceit=0, reset_changed=1, filtering=0) at /home/travis/build/neovim/bot-ci/build/neovim/src/nvim/fileio.c:2576 This is most likely due to the code that restores those values from `buf`, which happens just before the fatal call to `os_fileinfo` ```c /* * The autocommands may have changed the name of the buffer, which may * be kept in fname, ffname and sfname. */ if (buf_ffname) ffname = buf->b_ffname; if (buf_sfname) sfname = buf->b_sfname; if (buf_fname_f) fname = buf->b_ffname; if (buf_fname_s) fname = buf->b_sfname; ``` It's worth noting that at this point `ffname` is still non-NULL, so it _could_ be used. However, our current code is purely more strict than Vim in this area, which has caused us problems before (e.g., `getdigits()`). The commentary for `struct file_buffer` clearly indicate that all of `b_ffname`, `b_sfname`, and `b_fname` may be NULL: ```c /* * b_ffname has the full path of the file (NULL for no name). * b_sfname is the name as the user typed it (or NULL). * b_fname is the same as b_sfname, unless ":cd" has been done, * then it is the same as b_ffname (NULL for no name). */ char_u *b_ffname; /* full path file name */ char_u *b_sfname; /* short file name */ char_u *b_fname; /* current file name */ ``` Vim directly calls `stat(2)` which, although it is annotated to tell the compiler that the path argument is non-NULL, does handle a NULL pointer by returning a `-1` value and setting `errno` to `EFAULT`. This satisfies Vim's check, since it treats any `-1` return from `stat(2)` to mean the file doesn't exist (at least in this code path). Note that Vim's mch_stat() implementations on win32 and solaris clearly cannot accept NULL `name`. But the codepaths that call mch_stat will NULL `name` tend to be unix-only (eg: u_read_undo)!
* buf_write(): wrong argument to os_fileinfo_hardlinksJustin M. Keyes2017-08-09
| | | | | | | This was broken in ye olde refactor from 2014: e85fe0957d40080f43cbfcbe9eb8864475325b09 References #4370
* win_defs.h: redefine RGB macro after undefiningJustin M. Keyes2017-08-06
| | | | | | | Before this change, if os_defs.h was included after macros.h then win_defs.h would undefine our own RGB macro. vim-patch:8.0.0146
* 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
* main: Flush file in place of closing it, also do error reportingZyX2017-07-04
| | | | | | | | | | | | | | | | | | | | | Apparently on travis OS X systems it crashes when cleaning up streams with stdout closed: (lldb) bt all * thread #1: tid = 0x0000, 0x00007fff8703df06 libsystem_kernel.dylib`__pthread_kill + 10, stop reason = signal SIGSTOP * frame #0: 0x00007fff8703df06 libsystem_kernel.dylib`__pthread_kill + 10 frame #1: 0x00007fff93a764ec libsystem_pthread.dylib`pthread_kill + 90 frame #2: 0x00007fff97c056df libsystem_c.dylib`abort + 129 frame #3: 0x00007fff97bccdd8 libsystem_c.dylib`__assert_rtn + 321 frame #4: 0x0000000107a4e106 nvim`uv__close(fd=<unavailable>) + 102 at core.c:521 frame #5: 0x0000000107a5307d nvim`uv__loop_close(loop=0x00007fff5847c018) + 77 at loop.c:118 frame #6: 0x0000000107a4d149 nvim`uv_loop_close(loop=0x00007fff5847c018) + 57 at uv-common.c:626 frame #7: 0x000000010783e5bc nvim`stream_set_blocking(fd=0, blocking=true) + 204 at stream.c:34 frame #8: 0x000000010795d66b nvim`mch_exit(r=0) + 91 at os_unix.c:147 frame #9: 0x00000001078d5663 nvim`command_line_scan(parmp=0x00007fff5847c760) + 1779 at main.c:787 frame #10: 0x00000001078d4393 nvim`main(argc=2, argv=0x00007fff5847c898) + 163 at main.c:249 frame #11: 0x00007fff8cdd65ad libdyld.dylib`start + 1 frame #12: 0x00007fff8cdd65ad libdyld.dylib`start + 1
* os: Add OS_STD*_FILENO constantsZyX2017-07-04
|
* os/fileio: Add ability to use os/fileio.c for file descriptorsZyX2017-07-04
| | | | Code imported from #6299
* os/fileio: Add msgpack_file_write functionZyX2017-07-04
|
* 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.
* coverity/155509: negative close() argJustin M. Keyes2017-06-14
|
* 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
* pty_process_unix.c: include <libutil.h> on DragonFly BSDJustin M. Keyes2017-05-21
| | | | | | | From FreeBSD ports patch: https://svnweb.freebsd.org/ports/head/editors/neovim/files/patch-src_nvim_os_pty__process__unix.c?revision=425833&view=markup References https://github.com/neovim/neovim/issues/6771#issuecomment-302921368
* vim_getenv: Remove redundant NULL check.Justin M. Keyes2017-05-20
|
* startup: init v:progpath before calling vim_getenv (#6755)Justin M. Keyes2017-05-17
|
* env_iter: Learn `delim` parameter.Justin M. Keyes2017-05-15
|
* vim_getenv: Use v:progpath instead of os_exepath.Justin M. Keyes2017-05-15
|
* startup: v:progpath fallback: path_guess_exepathJustin M. Keyes2017-05-15
| | | | | | | If procfs is missing then libuv cannot find the exe path. Fallback to path_guess_exepath(), adapted from Vim findYourself(). Closes #6734
* os/shell.c: temporary solution to not put ctrl chars on the screen gridBjörn Linse2017-05-10
|
* refactor/single-include (#6687)Carlo Abelli2017-05-08
|