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

File completion and tilde (home repository) #62

Open
gwenn opened this issue Jul 27, 2016 · 1 comment
Open

File completion and tilde (home repository) #62

gwenn opened this issue Jul 27, 2016 · 1 comment

Comments

@gwenn
Copy link
Collaborator

gwenn commented Jul 27, 2016

To handle file completion like this ls ~userX/.

users = "0.5.1"
if let Some(user) = users::get_user_by_name("userX") {
    let home_dir = user.home_dir();
    // ...
}
@sector-f
Copy link

Seems like a good idea.

I should point out that zsh and bash handle this sort of thing differently: Bash's approach is "Try to expand, but leave it unchanged if there's nothing to expand." Zsh, on the other hand, gives an error, e.g. zsh: no such user or named directory: foo. At least, this is the default behavior; I'm unaware if it can be changed (but would not be surprised if it can).

gwenn pushed a commit to gwenn/rustyline that referenced this issue Nov 30, 2018
Check Rust str length before binding.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants