Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completing ~ by itself does nothing. #192

Closed
chrisant996 opened this issue Nov 3, 2021 · 2 comments
Closed

Completing ~ by itself does nothing. #192

chrisant996 opened this issue Nov 3, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@chrisant996
Copy link
Owner

chrisant996 commented Nov 3, 2021

Since Clink already supports cd -, it seems reasonable to also support cd ~.

However, it isn't feasible to try to automatically do ~ expansion for other commands, or when invoking other programs. The best that Clink can offer is expanding ~ when using completion (e.g. Tab). Tilde completion works in general, but is currently broken in a few specific places. I'll fix those as well, so that tilde completion works everywhere again.

This was originally proposed in #191.

@chrisant996 chrisant996 added the enhancement New feature or request label Nov 3, 2021
@chrisant996 chrisant996 changed the title Request: support cd ~ to change to the user profile directory. Completing ~ by itself does nothing. Nov 4, 2021
@chrisant996
Copy link
Owner Author

It turns out that it was intentional for completing ~ to do nothing, because in bash ~ and ~letters refer to user account names.

Referring to other user accounts doesn't seem to make a lot of sense in CMD on Windows, though.

So now completing ~ by itself inserts the %USERPROFILE% directory. This is a convenient way to expand tilde into a path that Windows understands.

@chrisant996
Copy link
Owner Author

Addressed by edcefba.

cd ~Tab now expands the tilde to the %USERPROFILE% path.

(All of the completion commands can expand ~ by itself; complete, menu-complete, old-menu-complete, clink-select-complete, possible-completions, and so on.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant
-