Closed michaelcontento closed 1 year ago
Same problem on a different Mac:
$ bash --version
GNU bash, version 4.4.0(1)-release (x86_64-apple-darwin15.6.0)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ python --version
Python 2.7.12
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.11.6
BuildVersion: 15G1004
Used terminals:
Just discovered this myself as well this morning :-(
ProductName: Mac OS X
ProductVersion: 10.11.6
BuildVersion: 15G1108
Terminal.app 2.6.1 (361.1)
Bash version 4.4.0(1)-release (x86_64-apple-darwin15.6.0)
Python version: 2.7.6
My .bashrc
: https://github.com/Integralist/dotfiles/blob/master/.bashrc
One thing that's interesting is if you try it from inside tmux, it kinda works?
In that you don't get the above error, so you can filter and navigate by arrow, but nothing else actually takes the match and puts it back on the command line for it to be used (so ultimately equally not useful lol) :-)
Don't know if that actually helps identify the source of the problem?
OK, so I've discovered that tmux was kinda working because it was loading the default system bash, where as once I configured it to use the homebrew install of bash it would error as per the above description @michaelcontento
Its related to bash > 4.4
If you remove the unnecessary subshell in:
col=$(echo $(get_cursor_position) | cut -f 2 -d " ")
and row=$(echo $(get_cursor_position) | cut -f 1 -d " ")
with:
--- bin/qfc.sh
+++ bin/qfc.sh
@@ -85,7 +85,7 @@ elif [[ -n "$BASH" ]]; then
# pretty similar to zsh flow
offset=${READLINE_POINT}
READLINE_POINT=0
- col=$(echo $(get_cursor_position) | cut -f 2 -d " ")
+ col=$(get_cursor_position | cut -f 2 -d " ")
word=${READLINE_LINE:0:offset}
word=${word##* }
@@ -100,7 +100,7 @@ elif [[ -n "$BASH" ]]; then
READLINE_LINE=${READLINE_LINE:0:$((offset-word_length))}${result}${READLINE_LINE:$((offset))}
offset=$(($offset - $word_length + $result_length))
- row=$(echo $(get_cursor_position) | cut -f 1 -d " ")
+ row=$(get_cursor_position | cut -f 1 -d " ")
tput cup $row $col
READLINE_POINT=${offset}
}
it works again
Nice @nougad - fancy making a quick PR? :-)
@Integralist if @nougad hasn't send a PR yet, maybe you can do it quickly yourself?
LGTM
Had the same problem #30 on Debian testing/buster:
bash --version
GNU bash, version 4.4.18(1)-release (x86_64-pc-linux-gnu)
Applied fd5d6e9, now everything is working fine. 1up for merge of the PR. Thanks!
I'll close this issue as it's fixed in #33
I've followed the instructions but somehow
read
inget_cursor_position
does fail on my mac. If I hit<ctrl>-f
on a fresh console my termial is stuck with the following message:But if I call
get_current_position
directly everything seems to work:I've added some
set -x
marks to the code inbin/qfc.sh
and here is some output that might help you:get_current_position
survived, butqfc_complete
will get stuck:And here some facts about my system: