diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9c52dca73..7aeeb023b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -47,6 +47,7 @@ Interactive improvements - The ``repaint-mode`` binding will now only move the cursor if there is repainting to be done. This fixes alt+something bindings in vi-mode (:issue:`7910`). - A new ``clear-screen`` bind function is used for :kbd:`Alt`\ +\ :kbd:`l` by default. This clears the screen and repaints the existing prompt at first, so it eliminates visible flicker unless the terminal is very slow (:issue:`10044`). +- A new variable, :envvar:`fish_cursor_external`, can be used to specify to cursor shape when a command is launched. When unspecified, the value defaults to the value of :envvar:`fish_cursor_default` (:issue:`4656`). Improved prompts ^^^^^^^^^^^^^^^^ diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst index bab02a0a2..28fb2c737 100644 --- a/doc_src/interactive.rst +++ b/doc_src/interactive.rst @@ -421,6 +421,9 @@ The ``fish_vi_cursor`` function will be used to change the cursor's shape depend # Set the replace mode cursors to an underscore set fish_cursor_replace_one underscore set fish_cursor_replace underscore + # Set the external cursor to a line. The external cursor appears when a command is started. + # The cursor shape takes the value of fish_cursor_default when fish_cursor_external is not specified. + set fish_cursor_external line # The following variable can be used to configure cursor shape in # visual mode, but due to fish_cursor_default, is redundant here set fish_cursor_visual block diff --git a/share/functions/fish_vi_cursor.fish b/share/functions/fish_vi_cursor.fish index 1ad23bc47..195a98cb1 100644 --- a/share/functions/fish_vi_cursor.fish +++ b/share/functions/fish_vi_cursor.fish @@ -92,7 +92,10 @@ function fish_vi_cursor -d 'Set cursor shape for different vi modes' echo " function fish_vi_cursor_handle_preexec --on-event fish_preexec - set -l varname fish_cursor_default + set -l varname fish_cursor_external + if not set -q \$varname + set varname fish_cursor_default + end if not set -q \$varname set varname fish_cursor_unknown end