Replies: 4 comments 2 replies
-
I've noticed that happens in konsole. When I quit yazi, the cursor is block, even though it was line before yazi. This doesn't happen in kitty. I have no solution, but a quick reset command brings it back. |
Beta Was this translation helpful? Give feedback.
-
Yazi uses Lines 31 to 33 in 9483798 Unfortunately, some terminals don't support these requests, and a simple solution is to reset the cursor when exiting Yazi - if you're using the shell wrapper, you can add: function y() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
yazi "$@" --cwd-file="$tmp"
+ echo -e -n "\x1b[\x36 q" # change cursor to steady bar
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
builtin cd -- "$cwd"
fi
rm -f -- "$tmp"
} into it to achieve this. See more available sequences at https://stackoverflow.com/questions/4416909/anyway-change-the-cursor-vertical-line-instead-of-a-box |
Beta Was this translation helpful? Give feedback.
-
Modify the function to allow run function yazi() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
/usr/bin/yazi "$@" --cwd-file="$tmp"
echo -e -n "\x1b[\x36 q" # change cursor to steady bar
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
builtin cd -- "$cwd"
fi
rm -f -- "$tmp"
} |
Beta Was this translation helpful? Give feedback.
-
For powershell users, paste the below funcion to your enum CursorStyle
{
block_blink = 1
block = 2
underline_blink = 3
underline = 4
bar_blink = 5
bar = 6
}
<#
.SYNOPSIS
set cursor style
#>
function Set-CursorStyle
{
param (
# style
[Parameter(Mandatory)]
[CursorStyle]$Style
)
Write-Output "`e[$([int]$Style) q"
} and you can set your cursor style after exiting yazi. Set-CursorStyle -Style bar |
Beta Was this translation helpful? Give feedback.
-
My terminal cursor style is line, and it cannot restore it after quitting yazi (yazi curosr style is block)
Beta Was this translation helpful? Give feedback.
All reactions