dundalek/closh

Cumbersome tab completion when name contains spaces

Opened this issue · 0 comments

Let's have a file with a name containing spaces:

$ touch "Space Separated.txt"

Current closh tab completion is not ideal.

Closh

After doing tab-completion

$ ls Spa<TAB>

We end up with errors:

$ ls Space Separated.txt
ls: cannot access 'Space': No such file or directory
ls: cannot access 'Separated.txt': No such file or directory

Or with a starting quote

$ ls "Spa<TAB>

It is better but one has to add ending quote to close the string:

$ ls "Space Separated.txt

Bash

Bash handles things a better way.

In the first case it escapes the whitespace:

$ ls Space\ Separated.txt

And in the second case it also adds the final quote and the command is ready to be executed right away:

ls "Space Separated.txt"