Ran into some auto-completion related problems while testing issue #7406.
To reproduce, follow steps below: (where ^ means pressing Tab key, * means cursor location)
(1) prompt$ cd to-a-test-directory
(2) prompt$ mkdir new-tmp-dir
(3) prompt$ cd !$
### now you should be in new-tmp-dir directory
(4) prompt$ echo test > tmp.txt
(5) prompt$ cat t^
prompt$ catmp.txt ## <<<< expanded to catmp.txt, should be 'cat tmp.txt'
(6) prompt$ cat ^
prompt$ cat tmp.txt* ## <=== expanded correctly; however, cursor (*) is not positioned as bash does; bash adds a space after a file expansion (if not a directory)
prompt$ cat tmp.txt * ## <--- this is how bash behaves, bash adds a space between tmp.txt and *
(7) prompt$ cat tmp.txt ^ ## continue pressing Tab key at the end, note that a space is added after tmp.txt, before Tab is pressed
prompt$ cat tmp.txt* ## <<<< expansion is not performed, and cursor is moved back by one column
prompt$ cat tmp.txt tmp.txt ## <-- this is the expected result
There are 2 places that fluid auto-completion failed, (5) and (7), indicated by <<<<.
There is 1 place that fluid auto-completion does not behave as bash, (6), indicated by <===.
Case 5 is fixes, I have sent the fix. But I do not think it was checked in yet.
I do not add a space after file expansion. I will look into this.
In case 7 there is no cursor moving back by one column.
>> In case 7 there is no cursor moving back by one column.
You might want to double check this behavior on Windows and Linux.
Below is the behavior on Windows and Linux, where * is cursor's location and ^ means pressing the Tab key:
(a) prompt$ cat tmp.txt * # there is a space between tmp.txt and *
(b) prompt$ cat tmp.txt *^ # press Tab key
(c) prompt$ cat tmp.txt* # this is the result from (b), auto-completion is not performed and * is moved back by one column and displayed right next to tmp.txt; the space displayed between tmp.txt and * in (b) disappeared
>> In case 7 there is no cursor moving back by one column.
You might want to double check this behavior on Windows and Linux.
Below is the behavior on Windows and Linux, where * is cursor's location and ^ means pressing the Tab key:
(a) prompt$ cat tmp.txt * # there is a space between tmp.txt and *
(b) prompt$ cat tmp.txt *^ # press Tab key
(c) prompt$ cat tmp.txt* # this is the result from (b), auto-completion is not performed and * is moved back by one column and displayed right next to tmp.txt; the space displayed between tmp.txt and * in (b) disappeared
Updated to head of trunk, SVN r29544. Case 5 and case 6 have been fixed, but still had problem to get case 7 to work.
bash behavior (* is cursor location, ^ means pressing Tab key):
(a) prompt$ cat *^
--> prompt$ cat tmp.txt *
(b) prompt$ cat tmp.txt *^
--> prompt$ cat tmp.txt tmp.txt *
Fluid behavior:
(A) prompt$ cat *^
--> prompt$ cat tmp.txt * ## expanded as bash does
(B) prompt$ cat tmp.txt *^ ## after Tab key is pressed, nothing happened (expected result is: cat tmp.txt tmp.txt *)
--> prompt$ cat tmp.txt *
Updated to head of trunk, SVN r29544. Case 5 and case 6 have been fixed, but still had problem to get case 7 to work.
bash behavior (* is cursor location, ^ means pressing Tab key):
(a) prompt$ cat *^
--> prompt$ cat tmp.txt *
(b) prompt$ cat tmp.txt *^
--> prompt$ cat tmp.txt tmp.txt *
Fluid behavior:
(A) prompt$ cat *^
--> prompt$ cat tmp.txt * ## expanded as bash does
(B) prompt$ cat tmp.txt *^ ## after Tab key is pressed, nothing happened (expected result is: cat tmp.txt tmp.txt *)
--> prompt$ cat tmp.txt *
Issue #7678 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build 12.0.0-rc-22 |
No time estimate |
Case 5 is fixes, I have sent the fix. But I do not think it was checked in yet.
I do not add a space after file expansion. I will look into this.
In case 7 there is no cursor moving back by one column.