aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_cursor_xterm.fish
blob: a82be021f0af3247ff4b4a4926eef445e1e1941f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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