소스 검색

previous approach actually wasn't working

Daniel Sheffield 3 달 전
부모
커밋
3b153b8d5f
1개의 변경된 파일8개의 추가작업 그리고 5개의 파일을 삭제
  1. 8 5
      rc/.bashrc

+ 8 - 5
rc/.bashrc

@@ -1,9 +1,12 @@
 #TODO: path must be install location
 . "$HOME"/git/recall/rc/.shrc
 
-insert() {
-	bind $'"\u200b":"'"$zle_prefix"'"'
-	perl -le 'require "sys/ioctl.ph";
-ioctl(STDIN, &TIOCSTI, $_) for split "", join " ", @ARGV' -- "$@"
+insert_with_delay() {
+  perl -le 'require "sys/ioctl.ph";
+            $delay = shift @ARGV;
+            unless(fork) {
+              select undef, undef, undef, $delay;
+              ioctl(STDIN, &TIOCSTI, $_) for split "", join " ", @ARGV;
+            }' -- "$@";
 }
-PROMPT_COMMAND="[ \"$zle_prefix\" ] && insert $'\u200b'"
+PROMPT_COMMAND='insert_with_delay 0.05 "$zle_prefix"'