-
Notifications
You must be signed in to change notification settings - Fork 0
/
__fish_cursor_xterm.fish.symlink
40 lines (37 loc) · 1.38 KB
/
__fish_cursor_xterm.fish.symlink
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Adapted from fish's __fish_cursor_xterm
# https://github.com/fish-shell/fish-shell/blob/d79f864072aa7264a5ab275fa5aefc64bbbe34da/share/functions/__fish_cursor_xterm.fish
#
# Fish is a smart and user-friendly command line shell.
#
# Copyright (C) 2005-2009 Axel Liljencrantz
# Copyright (C) 2009-2020 fish-shell contributors
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
function __fish_cursor_xterm -d 'Set cursor (xterm)'
set -l shape $argv[1]
switch "$shape"
case block
set shape 2
case underscore
set shape 4
case line
set shape 6
end
if contains blink $argv
set shape (math $shape - 1)
end
echo -en "\e[$shape q"
# Workaround https://github.com/fish-shell/fish-shell/issues/3481
commandline -f repaint
end