| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,18 @@ |
| 1 |
+__prompt_statusline_tput() |
|
| 2 |
+( |
|
| 3 |
+ [ "$(command -v tput)" ] || return 0 |
|
| 4 |
+ if echo "$TERM" | grep -q '^xterm\(-\|$\)' |
|
| 5 |
+ then |
|
| 6 |
+ export TERM='xterm+sl' |
|
| 7 |
+ fi |
|
| 8 |
+ tput "$@" |
|
| 9 |
+) |
|
| 10 |
+ |
|
| 11 |
+__prompt_statusline_tsl="$(__prompt_statusline_tput tsl)" |
|
| 12 |
+__prompt_statusline_fsl="$(__prompt_statusline_tput fsl)" |
|
| 13 |
+ |
|
| 14 |
+__prompt_statusline() |
|
| 15 |
+{
|
|
| 16 |
+ [ "$__prompt_statusline_tsl" ] || return 0 |
|
| 17 |
+ printf "$1" "${__prompt_statusline_tsl}${2}${__prompt_statusline_fsl}"
|
|
| 18 |
+} |