fix: ais zle widgets - pass tty correctly for terminal control
This commit is contained in:
@@ -8,7 +8,9 @@ fi
|
|||||||
|
|
||||||
# C-j: directory selector
|
# C-j: directory selector
|
||||||
ais-cd() {
|
ais-cd() {
|
||||||
local dir=$(ais cd)
|
zle -I
|
||||||
|
local dir=$(ais cd </dev/tty 2>/dev/tty)
|
||||||
|
zle -R
|
||||||
if [[ -n "$dir" ]]; then
|
if [[ -n "$dir" ]]; then
|
||||||
cd "$dir"
|
cd "$dir"
|
||||||
fi
|
fi
|
||||||
@@ -19,7 +21,9 @@ bindkey '^j' ais-cd
|
|||||||
|
|
||||||
# C-f: file selector -> insert into buffer
|
# C-f: file selector -> insert into buffer
|
||||||
ais-file() {
|
ais-file() {
|
||||||
local file=$(ais file)
|
zle -I
|
||||||
|
local file=$(ais file </dev/tty 2>/dev/tty)
|
||||||
|
zle -R
|
||||||
if [[ -n "$file" ]]; then
|
if [[ -n "$file" ]]; then
|
||||||
BUFFER+="$file"
|
BUFFER+="$file"
|
||||||
CURSOR=${#BUFFER}
|
CURSOR=${#BUFFER}
|
||||||
@@ -31,7 +35,9 @@ bindkey '^f' ais-file
|
|||||||
|
|
||||||
# C-r: history selector -> insert into buffer
|
# C-r: history selector -> insert into buffer
|
||||||
ais-hist() {
|
ais-hist() {
|
||||||
local cmd=$(ais hist)
|
zle -I
|
||||||
|
local cmd=$(ais hist </dev/tty 2>/dev/tty)
|
||||||
|
zle -R
|
||||||
if [[ -n "$cmd" ]]; then
|
if [[ -n "$cmd" ]]; then
|
||||||
BUFFER="$cmd"
|
BUFFER="$cmd"
|
||||||
CURSOR=${#BUFFER}
|
CURSOR=${#BUFFER}
|
||||||
|
|||||||
Reference in New Issue
Block a user