Skip to content

abbr: expand command abbrs after decorators#10396

Merged
faho merged 2 commits into
fish-shell:masterfrom
faho:decorated-abbr
Mar 27, 2024
Merged

abbr: expand command abbrs after decorators#10396
faho merged 2 commits into
fish-shell:masterfrom
faho:decorated-abbr

Conversation

@faho
Copy link
Copy Markdown
Member

@faho faho commented Mar 26, 2024

Currently, we expand command-abbrs (those with --position command) after if, but not after command or builtin or time:

abbr --add gc "git checkout"

will expand as if gc but not as command gc.

This was explicitly tested, but I have no idea why it shouldn't be?

Looking at the git history nothing really springs up as explanation.

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

Currently, we expand command-abbrs (those with `--position command`) after `if`, but not after `command` or `builtin` or `time`:

```fish
abbr --add gc "git checkout"
```

will expand as `if gc` but not as `command gc`.

This was explicitly tested, but I have no idea why it shouldn't be?
@faho faho added this to the fish next-3.x milestone Mar 26, 2024
@ridiculousfish ridiculousfish self-requested a review March 27, 2024 01:27
@ridiculousfish
Copy link
Copy Markdown
Member

I think I considered command to be an escape hatch in case you wanted to run some real command. But it's probably not wise to make abbreviations that are also real commands. Anyways I'm fine with this change.

@faho faho merged commit 217b009 into fish-shell:master Mar 27, 2024
@faho faho deleted the decorated-abbr branch March 27, 2024 16:18
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants