Ticket #4126: 0003-fixup-FISH-subshell-setup.patch

File 0003-fixup-FISH-subshell-setup.patch, 1.6 KB (added by ossi, 22 months ago)
  • src/subshell/common.c

    From 4162710f8750d46fb72a2d38891685ab5daeca32 Mon Sep 17 00:00:00 2001
    From: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
    Date: Thu, 8 Oct 2020 17:24:08 +0200
    Subject: [PATCH 3/7] fixup FISH subshell setup
    
    move binding commands out of the fish_prompt function definition, use
    consistent command separators, and remove excess backslashes from the
    bindings.
    
    amends ff0fc17a.
    ---
     src/subshell/common.c | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/src/subshell/common.c b/src/subshell/common.c
    index 1d422999e..3e1a2f7ee 100644
    a b init_subshell_precmd (char *precmd, size_t buff_size) 
    11361136        break; 
    11371137    case SHELL_FISH: 
    11381138        g_snprintf (precmd, buff_size, 
    1139                     " if not functions -q fish_prompt_mc;" 
     1139                    " bind \\e" SHELL_BUFFER_KEYBINDING " 'echo (commandline)>&%d';" 
     1140                    "bind \\e" SHELL_CURSOR_KEYBINDING " 'echo (commandline -C)>&%d';" 
     1141                    "if not functions -q fish_prompt_mc;" 
    11401142                    "functions -e fish_right_prompt;" 
    11411143                    "functions -c fish_prompt fish_prompt_mc; end;" 
    11421144                    "function fish_prompt;" 
    1143                     "bind \\e\\" SHELL_BUFFER_KEYBINDING " 'echo (commandline)>&%d'\n" 
    1144                     "bind \\e\\" SHELL_CURSOR_KEYBINDING " 'echo (commandline -C)>&%d'\n" 
    11451145                    "echo \"$PWD\">&%d; fish_prompt_mc; kill -STOP %%self; end\n", 
    11461146                    command_buffer_pipe[WRITE], command_buffer_pipe[WRITE], subshell_pipe[WRITE]); 
    11471147        break;