mirror of
https://github.com/atuinsh/atuin.git
synced 2025-02-16 18:32:05 +01:00
feat(zsh): Set terminal title to indicate atuin tui is active
This commit is contained in:
parent
b06b7b509a
commit
fe0f826d45
@ -27,6 +27,12 @@ fi
|
|||||||
export ATUIN_SESSION=$(atuin uuid)
|
export ATUIN_SESSION=$(atuin uuid)
|
||||||
ATUIN_HISTORY_ID=""
|
ATUIN_HISTORY_ID=""
|
||||||
|
|
||||||
|
_atuin_update_title() {
|
||||||
|
if [[ "$TERM" == xterm* ]]; then
|
||||||
|
print -n "\e]0;$1\a"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
_atuin_preexec() {
|
_atuin_preexec() {
|
||||||
local id
|
local id
|
||||||
id=$(atuin history start -- "$1")
|
id=$(atuin history start -- "$1")
|
||||||
@ -51,7 +57,7 @@ _atuin_precmd() {
|
|||||||
_atuin_search() {
|
_atuin_search() {
|
||||||
emulate -L zsh
|
emulate -L zsh
|
||||||
zle -I
|
zle -I
|
||||||
|
_atuin_update_title atuin
|
||||||
# swap stderr and stdout, so that the tui stuff works
|
# swap stderr and stdout, so that the tui stuff works
|
||||||
# TODO: not this
|
# TODO: not this
|
||||||
local output
|
local output
|
||||||
@ -64,12 +70,12 @@ _atuin_search() {
|
|||||||
RBUFFER=""
|
RBUFFER=""
|
||||||
LBUFFER=$output
|
LBUFFER=$output
|
||||||
|
|
||||||
if [[ $LBUFFER == __atuin_accept__:* ]]
|
if [[ $LBUFFER == __atuin_accept__:* ]]; then
|
||||||
then
|
|
||||||
LBUFFER=${LBUFFER#__atuin_accept__:}
|
LBUFFER=${LBUFFER#__atuin_accept__:}
|
||||||
zle accept-line
|
zle accept-line
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
_atuin_update_title zsh
|
||||||
}
|
}
|
||||||
_atuin_search_vicmd() {
|
_atuin_search_vicmd() {
|
||||||
_atuin_search --keymap-mode=vim-normal
|
_atuin_search --keymap-mode=vim-normal
|
||||||
|
Loading…
Reference in New Issue
Block a user