zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
25.01k stars 1.17k forks source link

Spaces are missed by >open #2014

Open SolarLune opened 3 years ago

SolarLune commented 3 years ago

Description of the problem or steps to reproduce

Hello!

If you try to open a file that has a space in its filename (i.e. >open assets/test file.json), Micro will open a file with the specified filepath up to the space (assets/test). Interestingly, autocomplete works correctly (i.e. typing open assets/test, and then pressing tab will complete the entirety of the path).

Specifications

Commit hash: 2.0.8, cfcb2e45 OS: Solus (Linux) Terminal: Tilix v1.9.3

zyedidia commented 3 years ago

You should put the name in double or single quotes if it has a space. The fact that autocompletion suggests this incorrectly is a problem though.

SolarLune commented 3 years ago

Ah, I see. Thanks for letting me know.

Should I leave this issue open for the autocompletion bug?

Gavin-Holt commented 3 years ago

Hi,

I note the micro.InfoBar():Prompt() command [1] also requires quotes if the user input contains spaces. We are accustomed to quoting filenames with spaces, but it is easy to forget when responding to input prompt.

Would it be better to return all the entered characters, for all command line responses?

Kind Regards Gavin Holt

[1] https://github.com/zyedidia/micro/issues/1913