chrisant996 / clink

Bash's powerful command line editing in cmd.exe
https://chrisant996.github.io/clink/
GNU General Public License v3.0
3.44k stars 135 forks source link

Replace unix path separator on complete #651

Closed zdm closed 1 month ago

zdm commented 1 month ago

Hi.

Previously, when I type, for example, "./2" and press "TAB" to complete file name - clink replace "./2" with ".\2" and complete filename with the file started with "2" from the current directory.

But after some clink update (I don't remebmer which version exactly) it require me to use windown path separator "\" only.

This is not very suitable.

Could you please tell me, what option in config I should set to restore old behaviour. I belive, that you move it to option )).

Thank you!

chrisant996 commented 1 month ago

All changes are listed at Changes in the documentation.

You're looking for this one:

Run clink set match.translate_slashes to see more about the setting.

Run clink set match.translate_slashes system to select the previous behavior of converting forward slashes to backslashes.

zdm commented 1 month ago

Thank you for answer.

I tried auto, system, backslash.

Nothing works. When I am typing "./1" and press TAB - completion just not performed. Slash not changed.

With "backslash" option - when I am typing ".\1" - it works ( change path to "./1" and make completion), bun this is no what I meed.

chrisant996 commented 1 month ago

Oh, I understand now. The original description did not mention that completion is not performed, and I thought you were reporting that completion worked but kept the forward slash.

What changed and why

The command line parser was changed to respect how CMD syntax works.

Parsing the command line in Clink now respects that, so that input line coloring can be accurate and so for example you can type dir/Tab and get completions for / flags to dir.

What you want

I understand what you want, and why.

I'll have to think about how that can be accommodated.

zdm commented 1 month ago

Ok, thank you very much. I am wondering, that it worked some time ago.

chrisant996 commented 1 month ago

@zdm When completing the first word in a command line:

  1. Do you only need completing ./ to convert the slash?
  2. Or do you also need somedir/ to convert the slash?

Case 1 is easy to allow an exception for. Case 2 is much more problematic to accommodate, so I'd rather not introduce complexity and inconsistencies for that case.

zdm commented 1 month ago

I am personally use "./xxx" only. It it fast and easy to type when I need to complete filename from the current directory.