Always handle mktemp failure in user-facing code

mktemp might be missing, see #11972
This commit is contained in:
Johannes Altmanninger
2025-10-22 09:49:45 +02:00
parent 037a399746
commit 034cd7ea35
3 changed files with 8 additions and 3 deletions

View File

@@ -44,12 +44,14 @@ function edit_command_buffer --description 'Edit the command buffer in an extern
break
end
set cursor_from_editor (__fish_mktemp_relative fish-edit_command_buffer)
or return
set -a editor +$line "+norm! $col|" $f \
'+au VimLeave * ++once call writefile([printf("%s %s %s", shellescape(bufname()), line("."), col("."))], "'$cursor_from_editor'")'
case emacs emacsclient gedit
set -a editor +$line:$col $f
case kak
set cursor_from_editor (__fish_mktemp_relative fish-edit_command_buffer)
or return
set -a editor +$line:$col $f -e "
hook -always -once global ClientClose %val{client} %{
echo -to-file $cursor_from_editor -quoting shell \