| Age | Commit message (Collapse) | Author |
|
|
|
Extract the logic for "waiting for shell to finish" and reuse it for
potentially blocking calls to open() that use the O_WRONLY flags.
|
|
Refactor ShellManager and pipe to feed lines from the buffer directly,
this should reduce memory use when piping big chunks of buffers.
The pipe output is still provided as a single big buffer.
|
|
|
|
Lots of code includes buffer_utils.hh just for write_to_debug_buffer
which pulls many unnecessary dependencies. Reorganise to reduce
compile times.
|
|
This makes it easier to pass shell fragments as arguments so that
%sh{ eval "$@" } just works even if arguments refer to Kakoune's
vars.
|
|
Read output from the script as it comes and update the candidate
list progressively.
Disable updating of the list when a completion has been explicitely
selected.
|
|
|
|
Fixes #5023
|
|
This removes the need for the setup_child callback which is quite
tricky as it cannot touch any memory due to vfork, and removes the
Pipe abstraction in favor of a more general UniqueFd one.
|
|
Closes #4907
|
|
Fixes #4501
|
|
Closing/reopening the read side seems to sometimes lead to
end-of-file not being received, leaving some extra data unexecuted.
The FDWatcher stays disabled during the executing of the fifo
commands so this should not enable any more commands to be executed
until we get back from the CommandManager and reset the FDWatcher
fd to to fifo read end.
Fixes #4410
|
|
This is one of the issues raised by #4410
|
|
This happens on termux for example.
|
|
This meaning is only used in C++ sources. The docs use "env
var"/"environment variable" a few times for actual environment
variables.
|
|
Log error to debug buffer and Change the 'waiting for shell' face
to 'Error'.
Update the 'waiting for shell' message when the shell has exited
but Kakoune is still waiting on stdin/stdout/stderr to be closed.
|
|
Those fifos are accessible during %sh{...} blocks, the command fifo
executes commands written to it once the write end side is closed
(multiple open/write/close sequences are supported), the response
fifo is a simple helper fifo available to write response back to
the shell process
An example use of this feature is to request some list options
content from without being limited by the environment size:
```
%sh{
echo "echo -to-file $kak_response_fifo -quoting shell -- %opt{some_list}" > $kak_command_fifo
eval "set -- $(cat $kak_response_fifo)"
}
```
|
|
|
|
|
|
|
|
If a %sh{} script refers to any variables multiple times they are all multiply
included in the environment. Example: if a %sh{} invocation refers to
${kak_buffile} 5 times, the environment will have "kak_buffile=..." repeated 5
times and so on. This repetition happens for each multiply used variable that
is passed into the environment.
The variable should, of course, be only passed into the environment once. This
commit should fix this issue.
|
|
This avoids 100% CPU usage when we have pending fifo input while running
a shell process, as we will not end-up busy looping in pselect but not
reading the available data due to being only processing urgent events.
|
|
|
|
This should be rare but should not happen silently, this way it will
show in the parent process debug buffer.
|
|
|
|
Add that libexec directory to the PATH instead of the current kak
binary directory to avoid impacting other commands.
The libexec directory currently only contains a symlink back to
the Kakoune binary.
|
|
This makes it possible to do :select `%val{selections_decs}` and to
correctly combine $kak_quoted with those.
|
|
|
|
|
|
|
|
Fixes #2653
|
|
Closes #2620
The docs for Mac OS X's vfork() requires it, and _exit() conforms to
POSIX.1-2008.
http://man7.org/linux/man-pages/man2/_exit.2.html
|
|
SIG_IGN is inherited after 'execve' and requires us to reset
that signal handler, which does not work well with vfork on
OSX. Using an empty function does the trick and will be auto
reset to default on exec.
|
|
The shell will always be run with 'sh' as argv[0] to make shells such
as busybox sh supported.
Closes #2547
|
|
When large buffers have been opened, copying Kakoune's memory
page descriptors can get pretty slow, making fork more expensive
than necessary.
vfork avoids that problem. While not strictly conforming, it seems
the few calls we do before execve (open, close, dup2 and
set_signal_handler) would not cause any problems on platforms we
care about.
|
|
Add a test case to validate roundtrips between Kakoune and the
shell.
|
|
Fixes #2238
|
|
With this fix, tests can now use /dev/null as stdin.
Fixes #2165
|
|
Fixes #2079
|
|
set-face now takes a scope argument, and faces can be overridden on
a buffer or window basis.
colorscheme apply on global scope, which should be good enough for
now.
Fixes #1411
|
|
Fixes prompt getting erased by the wait for shell message, and
having to manually trigger a redraw to see it again.
|
|
Fixes #1973
|
|
|
|
This overload will forward to the general transform implementation
using std::mem_fn to generate a callable.
|
|
No need to go through a static list and then copy them one by
one in a vector.
|
|
|
|
|
|
|
|
to child
Fixes #1330
Fixes #1331
|