fish-shell / fish-shell/fish-shell

abbr doesn't kick in after tab

Open
#7,374 4 comments 0 reactions 0 assignees View on GitHub
enhancement RFC
Dominant language
Rust
Stars
34.2k
Forks
2.4k
Avg merge
2d 8h
Merged PRs (30d)
13

Description

*I'm opening an issue rather than committing a fix directly because I'm not entirely certain what the default behavior should be in this scenario.*

If you have `abbr camcontrol "sudo camcontrol"` and then start a command with `camcontrol `, the prompt will update to `$ sudo camcontrol `, but if you instead type in part of the command name and let it autocomplete the rest,† e.g. `camcontrol` the prompt will change to `$ camcontrol ` with the abbreviation not kicking in.

I know there are basically two use cases for abbr, one for "shortcuts" and the other for typo corrections. I personally discourage the use of abbr for shortcuts and think that functions should be used, but I can see how completions wouldn't be taking abbr into account in that case. However for "typo" correction (`gti` -> `git`, `foo` -> `sudo foo`), I think we might want to check the abbr list post-completion for the sake of uniformity?

† here for the sake of reducing completion ambiguity the entirety of the command name will be typed in before completing

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.