mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 10:01:46 +08:00
Improve fork reporting
Save a couple of forks during init
This commit is contained in:
parent
675106cfa5
commit
fb2ed355ec
8
exec.cpp
8
exec.cpp
|
@ -561,7 +561,7 @@ void exec( parser_t &parser, job_t *j )
|
|||
*/
|
||||
int exec_error=0;
|
||||
|
||||
int needs_keepalive = 0;
|
||||
bool needs_keepalive = false;
|
||||
process_t keepalive;
|
||||
|
||||
|
||||
|
@ -672,12 +672,12 @@ void exec( parser_t &parser, job_t *j )
|
|||
{
|
||||
if( p->next )
|
||||
{
|
||||
needs_keepalive = 1;
|
||||
needs_keepalive = true;
|
||||
break;
|
||||
}
|
||||
if( p != j->first_process )
|
||||
{
|
||||
needs_keepalive = 1;
|
||||
needs_keepalive = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1216,7 +1216,7 @@ void exec( parser_t &parser, job_t *j )
|
|||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
if (g_log_forks) {
|
||||
printf("Executing fork for internal builtin for '%ls' (io is %p, job_io is %p)\n", p->argv0(), io, j->io);
|
||||
printf("fork #%d: Executing fork for internal builtin for '%ls' (io is %p, job_io is %p)\n", g_fork_count, p->argv0(), io, j->io);
|
||||
io_print(io);
|
||||
}
|
||||
pid = execute_fork(false);
|
||||
|
|
|
@ -207,7 +207,12 @@ function __fish_config_interactive -d "Initializations that should be performed
|
|||
|
||||
# Reload keybindings when binding variable change
|
||||
function __fish_reload_key_bindings -d "Reload keybindings when binding variable change" --on-variable fish_key_bindings
|
||||
eval $fish_key_bindings ^/dev/null
|
||||
# Do something nasty to avoid two forks
|
||||
if test "$fish_key_bindings" = fish_default_key_bindings
|
||||
fish_default_key_bindings
|
||||
else
|
||||
eval $fish_key_bindings ^/dev/null
|
||||
end
|
||||
end
|
||||
|
||||
# Load keybindings
|
||||
|
|
Loading…
Reference in New Issue
Block a user