I have two files:
SUM-12_schematic.pdf VMware-Workstation-Full-10.0.1-1379776.x86_64.txt
Doing:
# ls SUM<tab>
works as expected and completes the filename but doing:
# sh -f VMw<tab>
does not work. The filename is not completed.
Clearly someone is trying to "help" me and not complete a file that sh is not normally known to be used with sh.
Can someone tell me how to disable this "helpful" behavior?
Mike
On 11/05/2016 12:40 PM, Michael B Allen wrote:
Clearly someone is trying to "help" me and not complete a file that sh is not normally known to be used with sh.
/usr/share/bash-completion/completions/sh
Can someone tell me how to disable this "helpful" behavior?
Either delete that file or fix it. Copying it to /etc/bash_completion.d might override that one. Otherwise it will get replaced the next time the bash-completion package is updated.
On Sat, 5 Nov 2016 15:40:54 -0400 Michael B Allen ioplex@gmail.com wrote:
I have two files:
SUM-12_schematic.pdf VMware-Workstation-Full-10.0.1-1379776.x86_64.txt
Doing:
# ls SUM<tab>
works as expected and completes the filename but doing:
# sh -f VMw<tab>
does not work. The filename is not completed.
Clearly someone is trying to "help" me and not complete a file that sh is not normally known to be used with sh.
Can someone tell me how to disable this "helpful" behavior?
I think Andras answered your question, but here's a workaround. Install gpm, the terminal mouse program. Then if you do an ls, and double click on the file name, it will put the name in a buffer. Then type your command, and where you would put the file name paste the buffer with the center button. I use this as much as completion, but even more I use ctrl-r to search and reuse history the second time I use the command.
eg
ls VM* double click on name sh -f center paste name
On Sat, 2016-11-05 at 16:57 -0700, stan wrote:
On Sat, 5 Nov 2016 15:40:54 -0400 Michael B Allen ioplex@gmail.com wrote:
I have two files:
SUM-12_schematic.pdf VMware-Workstation-Full-10.0.1-1379776.x86_64.txt
Doing:
# ls SUM<tab>
works as expected and completes the filename but doing:
# sh -f VMw<tab>
does not work. The filename is not completed.
Clearly someone is trying to "help" me and not complete a file that sh is not normally known to be used with sh.
Can someone tell me how to disable this "helpful" behavior?
I think Andras answered your question, but here's a workaround. Install gpm, the terminal mouse program. Then if you do an ls, and double click on the file name, it will put the name in a buffer. Then type your command, and where you would put the file name paste the buffer with the center button. I use this as much as completion, but even more I use ctrl-r to search and reuse history the second time I use the command.
eg
ls VM* double click on name sh -f center paste name
I think the X server does that directly. It works in every text pane, not just Shell terminals. No need to install gpm.
poc
On Sun, 06 Nov 2016 00:40:20 +0000 Patrick O'Callaghan pocallaghan@gmail.com wrote:
I think the X server does that directly. It works in every text pane, not just Shell terminals. No need to install gpm.
You are right. gpm is 'A mouse server for the Linux console'.
This characteristic of X is a pain in gvim where it pastes at the copy point instead of the last insertion point, unlike vim in a console, where it pastes at the current insertion point. i.e. in gvim, X moves the current insertion point to the double click, while in a console the insertion point remains where it was. A big difference in efficiency when editing, especially when doing quick variable name copies to avoid typing.
This doesn't happen in an X term since there is only one insertion point. I just checked, and it pastes properly there.
On 11/05/2016 06:59 PM, stan wrote:
This characteristic of X is a pain in gvim where it pastes at the copy point instead of the last insertion point, unlike vim in a console, where it pastes at the current insertion point. i.e. in gvim, X moves the current insertion point to the double click, while in a console the insertion point remains where it was. A big difference in efficiency when editing, especially when doing quick variable name copies to avoid typing.
This doesn't happen in an X term since there is only one insertion point. I just checked, and it pastes properly there.
In gvim, X doesn't move the insertion point. Gvim is a graphical application, so it knows fully about the mouse. Vim is a console application and does not know about the mouse. In that case, the middle click is interpreted by the terminal program which feeds the clipboard contents as keyboard input. As a very clear example, compare the difference between gvim and vim when pasting while in command mode.