| Commit message (Collapse) | Author | Age |
... | |
| | |
|
|/ |
|
|
|
|
|
|
|
| |
- avoid null passed to ELOG format string
- receive (char *) internally
- modify identifier names for consistency
- edit comments for concision and consistency
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is how Nvim behaves when the "abstract_ui" termcap is activated:
- No data is written/read to stdout/stdin by default.
- Instead of sending data to stdout, ui_write will parse the termcap codes
and invoke dispatch functions in the ui.c module.
- The dispatch functions will forward the calls to all attached UI
instances(each UI instance is an implementation of the UI layer and is
registered with ui_attach).
- Like with the "builtin_gui" termcap, "abstract_ui" does not contain any key
sequences. Instead, vim key strings(<cr>, <esc>, etc) are parsed directly by
input_enqueue and the translated strings are pushed to the input buffer.
With this new input model, its not possible to send mouse events yet. Thats
because mouse sequence parsing happens in term.c/check_termcodes which must
return early when "abstract_ui" is activated.
|
|
|
|
|
|
|
|
|
| |
Shell command output was broken in @8a5a8db, which refactored nvim to no longer
switch to cooked mode(linefeeds are processed differently).
Fix the problem by refactoring write_output to accept to extra arguments that
control the flushing behavior and where data will be written to: buffer or
directly to the screen.
|
| |
|
| |
|
|
|
|
|
|
| |
Nvim now relies much less on setting terminal mode to cooked mode, remove most
calls to settmode, except for those that happen on startup or when suspending.
Eventually even those will be handled by the UI layer.
|
|\
| |
| | |
constify and func-attribute memory.c and strings.c
|
| | |
|
| |
| |
| |
| | |
Also move read_error_exit to os/input.c
|
|/
|
|
|
|
|
|
|
| |
Also:
- Remove NO_CONSOLE_INPUT/NO_CONSULE preprocessor conditionals
- Remove ctrl_c_interrupts variable, check for mapped_ctrl_c directly in
process_interrupts()
- Move ui_inchar profiling to input_poll which is where Nvim blocks for input.
|
|
|
|
|
|
|
| |
Two new functions, `event_enable_deferred()`/`event_disable_deferred()` have to
be called by code that is capable of handling asynchronicity. User-dialog states
like "press ENTER to continue" or the swap file confirmation no longer will
generate K_EVENT.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Commit @45525853d352 removed usage of the `job_write_cb` for closing stdin due
to a memory error, but that doesn't work anymore because `job_close_in` closes
stdin immediately, possibly trimming input data before it is fully written.
Since most memory issues with jobs have been fixed, re-add the `job_write_cb`
call to ensure stdin is only closed when it should. Also add tests for scenarios
where using the callback makes a difference.
|
|
|
|
|
|
|
| |
An uv_pipe_t handle for a WStream could be left open for a
particular code path.
Patch by tarruda.
|
|
|
|
|
| |
The argument argv of job_start() and channel_from_job() will be
freed. Mark them as such in the comments of this functions.
|
|
|
|
|
| |
If a new job cannot be started because no slots are free, we return early
without freeing the argv argument.
|
|
|
|
|
| |
Needed for accessing this information without direct access to the
rstream_buffer.
|
|
|
|
|
| |
stdout/stderr should only be closed after the job truly exits, or else we can
lose data sent by it.
|
|
|
|
|
| |
Travis build will now fail when core files are dumped, so call `abort()` when
the event loop is not fully released before exiting.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- Add input_teardown/signal_teardown to take care of closing signal/stdin
handles.
- Call those functions in event_teardown, and ensure there are no active handles
by entering an infinite loop when there are unclosed handles(think of this as
an assertion that can't go unoticed on travis).
- Move event_teardown call to the end of mch_exit. That is required because
event_poll may still be called in that function.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit @264e0d872c("Remove automatic event deferral") removed the immediate
event queue because event deferral now had to be explicit. The problem is that
while some events don't need to be deferred, they still can result in recursive
`event_poll` calls, and recursion is not supported by libuv. Examples of those
are msgpack-rpc requests while a server->client request is pending, or signals
which can call `mch_exit`(and that will result in `uv_run` calls).
To fix the problem, this reintroduces the immediate event queue for events that
can potentially result in event loop recursion. The non-deferred events are
still processed in `event_poll`, but only after `uv_run` returns.
|
| |
|
|
|
|
|
|
| |
- Rename WriteData to WRequest
- Inline uv_write_t into WRequest, avoiding an extra allocation
- Manage WBuffer/WRequest instances using klib memory pools
|
|
|
|
|
| |
Remove the current teardown logic and reuse the job top timers with
event_poll_until all jobs exit or are killed.
|
| |
|
|
|
|
|
|
|
| |
Use a timer to periodically compare the current HR time against the HR time of
when `job_stop` was called. After 1 second, send SIGTERM, after 2 seconds, send
SIGKILL. The timer is only active when there's at least one `job_stop` call
pending.
|
| |
|
| |
|
|
|
|
| |
To follow our coding conventions
|
|
|
|
|
|
|
|
| |
Passing NULL as the callback for stdout/stderr will result in job_start ignoring
stdout/stderr, respectively. A 'writable' boolean argument was also added, and
when false `job_start` will ignore stdin.
Also, refactor os_system to allow passing NULL as the `output` argument.
|
|
|
|
|
|
|
| |
Commit @709685b4612f4 removed the close_job_* calls when uv_spawn fails because
of memory errors when trying to cleanup unitialized {R,W}Stream instances, but
the uv_pipe_t instances must be closed because they are added to the event loop
queue by previous `uv_pipe_init()` calls
|
| |
|
|
|
|
|
|
|
|
| |
The `vim_feedkeys` must be deferred because it can potentially free the buffer
passed to `os_inchar`(which in turns calls `vim_feedkeys` indirectly).
The new `vim_input` function can be used to emulate user input(Since it does not
mess with the typeahead, it is safe to execute without deferring).
|
|
|
|
|
| |
Input buffer must be bigger than read buffer to ensure it always has space for
converted data.
|
|
|
|
|
|
|
|
|
| |
- Extract `process_interrupts` out of `convert_input`
- Instead of waiting for os_breakcheck/os_inchar calls, call `convert_input`
and `process_interrupts` directly from the read callback in input.c.
- Remove the `settmode` calls from `job_wait`. Now that interrupts are
processed in the event loop, there's no need to set the terminal to cooked
which introduces other problems(ref 7.4.427)
|
|
|
|
|
|
| |
The streams job_close_*() reference have not been initialized by the
time we call uv_spawn() and libuv closes these pipes for us when spawn()
fails.
|
|
|
|
|
|
|
| |
The `rbuffer_consumed` was being passed a consumed count from another buffer,
causing integer overflow in `rbuffer_relocate`.
Fixes #1343
|
|
|
|
| |
This is required to prevent the scenario explained by @akkartik in #1324
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's possible that a child process won't close it's standard streams, even after
it exits. This can be evidenced with the "xclip" program:
:call system('xclip -i -selection clipboard', 'DATA')
Before this commit, the above command wouldn't return, even though the xclip
program had exited. That is because `xclip` wasn't closing it's stdout/stderr
streams, which would block pending_refs from ever reaching 0.
Now the job.c module was refactored to ensure all streams are closed when the
uv_process_t handle is closed.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
All files under the os, api and msgpack_rpc directories have -Wconversion
automatically applied. CONV_SOURCES is also checked for missing files(when
renaming, for example)
|
|
|
|
|
|
|
| |
A pattern that is becoming common across the project is to poll for events until
a certain condition is true, optionally passing a timeout. To address this
scenario, the event_poll_until macro was created and the job/channel/input
modules were refactored to use it on their blocking functions.
|