mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 15:18:50 +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 exec_error=0;
|
||||||
|
|
||||||
int needs_keepalive = 0;
|
bool needs_keepalive = false;
|
||||||
process_t keepalive;
|
process_t keepalive;
|
||||||
|
|
||||||
|
|
||||||
|
@ -672,12 +672,12 @@ void exec( parser_t &parser, job_t *j )
|
||||||
{
|
{
|
||||||
if( p->next )
|
if( p->next )
|
||||||
{
|
{
|
||||||
needs_keepalive = 1;
|
needs_keepalive = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if( p != j->first_process )
|
if( p != j->first_process )
|
||||||
{
|
{
|
||||||
needs_keepalive = 1;
|
needs_keepalive = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1216,7 +1216,7 @@ void exec( parser_t &parser, job_t *j )
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
if (g_log_forks) {
|
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);
|
io_print(io);
|
||||||
}
|
}
|
||||||
pid = execute_fork(false);
|
pid = execute_fork(false);
|
||||||
|
|
|
@ -207,8 +207,13 @@ function __fish_config_interactive -d "Initializations that should be performed
|
||||||
|
|
||||||
# Reload keybindings when binding variable change
|
# Reload keybindings when binding variable change
|
||||||
function __fish_reload_key_bindings -d "Reload keybindings when binding variable change" --on-variable fish_key_bindings
|
function __fish_reload_key_bindings -d "Reload keybindings when binding variable change" --on-variable fish_key_bindings
|
||||||
|
# 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
|
eval $fish_key_bindings ^/dev/null
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Load keybindings
|
# Load keybindings
|
||||||
__fish_reload_key_bindings
|
__fish_reload_key_bindings
|
||||||
|
|
Loading…
Reference in New Issue
Block a user