subshell: ensure compatibility with fish 3.8

The upcoming fish 3.8 will add a feature flag to officially deprecate
"%self," see

8d71eef1da

Unfortunately this can cause mc+fish to break for users who configured
fish with "set -U fish_features all" which opts into any new feature
flag, thus disabling %self expansion.

Prevent this potential breakage by using the recommended "$fish_pid",
which was introduced in fish 3.0.0 (December 2018).

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
This commit is contained in:
Johannes Altmanninger 2024-08-07 09:50:28 +02:00 committed by Yury V. Zaytsev
parent b921ad32fc
commit c249980ed3
1 changed files with 1 additions and 1 deletions

View File

@ -1176,7 +1176,7 @@ init_subshell_precmd (char *precmd, size_t buff_size)
"functions -e fish_right_prompt;" "functions -e fish_right_prompt;"
"functions -c fish_prompt fish_prompt_mc; end;" "functions -c fish_prompt fish_prompt_mc; end;"
"function fish_prompt;" "function fish_prompt;"
"echo \"$PWD\">&%d; fish_prompt_mc; kill -STOP %%self; end\n", "echo \"$PWD\">&%d; fish_prompt_mc; kill -STOP $fish_pid; end\n",
command_buffer_pipe[WRITE], command_buffer_pipe[WRITE], subshell_pipe[WRITE]); command_buffer_pipe[WRITE], command_buffer_pipe[WRITE], subshell_pipe[WRITE]);
break; break;