aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_cursor_xterm.fish
diff options
context:
space:
mode:
Diffstat (limited to 'share/functions/__fish_cursor_xterm.fish')
-rw-r--r--share/functions/__fish_cursor_xterm.fish16
1 files changed, 16 insertions, 0 deletions
diff --git a/share/functions/__fish_cursor_xterm.fish b/share/functions/__fish_cursor_xterm.fish
new file mode 100644
index 00000000..a82be021
--- /dev/null
+++ b/share/functions/__fish_cursor_xterm.fish
@@ -0,0 +1,16 @@
+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 (expr $shape - 1)
+ end
+ echo -en "\e[$shape q"
+end