From ab39fab68c5060f477e2f51f8c6aaebb9d0d9a33 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 25 Oct 2025 17:24:39 +0200 Subject: [PATCH] Fix a wrong path to fish_indent on OpenBSD If fish is invoked as execve("/bin/fish", "fish") on OpenBSD, "status fish-path" will output "fish". As a result, our wrapper for fish_indent tries to execute "./fish" if it exists. We actually no longer need to call any executable, since "fish_indent" is available as builtin now. Stop using the wrapper, fixing the OpenBSD issue. --- share/functions/__fish_indent.fish | 2 ++ share/functions/edit_command_buffer.fish | 4 ++-- share/functions/fish_clipboard_copy.fish | 4 ++-- share/functions/funced.fish | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/share/functions/__fish_indent.fish b/share/functions/__fish_indent.fish index 99b354540..bb4f4633c 100644 --- a/share/functions/__fish_indent.fish +++ b/share/functions/__fish_indent.fish @@ -1,3 +1,5 @@ +# TODO(embed-data) Remove this after that has been rolled out (on-by-default). + # localization: skip(private) set -l dir "$(path dirname -- (status fish-path))" diff --git a/share/functions/edit_command_buffer.fish b/share/functions/edit_command_buffer.fish index fade32598..b91f2e143 100644 --- a/share/functions/edit_command_buffer.fish +++ b/share/functions/edit_command_buffer.fish @@ -9,7 +9,7 @@ function edit_command_buffer --description 'Edit the command buffer in an extern set -l editor (__fish_anyeditor) or return 1 - set -l indented_lines (commandline -b | __fish_indent --only-indent) + set -l indented_lines (commandline -b | fish_indent --only-indent) string join -- \n $indented_lines >$f set -l offset (commandline --cursor) # compute cursor line/column @@ -83,7 +83,7 @@ function edit_command_buffer --description 'Edit the command buffer in an extern $editor set -l raw_lines (command cat $f) - set -l unindented_lines (string join -- \n $raw_lines | __fish_indent --only-unindent) + set -l unindented_lines (string join -- \n $raw_lines | fish_indent --only-unindent) # Here we're checking the exit status of the editor. if test $status -eq 0 -a -s $f diff --git a/share/functions/fish_clipboard_copy.fish b/share/functions/fish_clipboard_copy.fish index 74b1cd74c..a4ea2521b 100644 --- a/share/functions/fish_clipboard_copy.fish +++ b/share/functions/fish_clipboard_copy.fish @@ -3,8 +3,8 @@ function fish_clipboard_copy if isatty stdin # Copy the current selection, or the entire commandline if that is empty. # Don't use `string collect -N` here - `commandline` adds a newline. - set cmdline (commandline --current-selection | __fish_indent --only-indent | string collect) - test -n "$cmdline"; or set cmdline (commandline | __fish_indent --only-indent | string collect) + set cmdline (commandline --current-selection | fish_indent --only-indent | string collect) + test -n "$cmdline"; or set cmdline (commandline | fish_indent --only-indent | string collect) else # Read from stdin while read -lz line diff --git a/share/functions/funced.fish b/share/functions/funced.fish index 39190c1c8..3c3d80222 100644 --- a/share/functions/funced.fish +++ b/share/functions/funced.fish @@ -45,12 +45,12 @@ function funced --description 'Edit function definition' if test "$editor" = fish if functions -q -- $funcname - functions --no-details -- $funcname | __fish_indent --only-unindent | __fish_indent --no-indent | read -z init + functions --no-details -- $funcname | fish_indent --only-unindent | fish_indent --no-indent | read -z init end set -l prompt 'printf "%s%s%s> " (set_color green) $funcname (set_color normal)' if read -p $prompt -c "$init" --shell cmd - echo -n $cmd | __fish_indent --only-unindent | read -lz cmd + echo -n $cmd | fish_indent --only-unindent | read -lz cmd eval "$cmd" end if set -q _flag_save