⚡ Sangsakala Proxy 🏠 Home
Skip to content

Add Abbreviation #28297

Open
Open

Description

@walid2mi2025-dot

Summary of the new feature / enhancement

Hi,

Abbreviations work on the same principle as aliases but with the main advantage that an abbreviation will get expanded 'live' as is being typed.

# add static anbreviation
PS> add-abreviation vlc 'very-very-long-command -parm 1 |  .....etc'

PS> show-abbrevation
vlc 

PS> vlc <cltr space> very-very-long-command -parm 1 |  .....etc

PS> remove-abbreviation vlc

This great finctionnality is from fish shell

Proposed technical implementation details (optional)

No response

Activity

  1. added
    Issue-Enhancementthe issue is more of a feature request than a bug
    Needs-TriageThe issue is new and needs to be triaged by a work group.
    on Nov 1, 2026
  2. 237dmitry commented on Nov 1, 2026

    @237dmitry

    How does it differ from a function?

  3. sharpchen commented on Nov 1, 2026

    @sharpchen
  4. 237dmitry commented on Nov 1, 2026

    @237dmitry

    I think, *-competion is not the shell option. If you look what package is own some completion then you get result like this:

    $ pacman -Qo /usr/share/bash-completion                   
    /usr/share/bash-completion/ is owned by appstream 1.2.2-1
    /usr/share/bash-completion/ is owned by audit 4.2.1-1
    /usr/share/bash-completion/ is owned by bash-completion 2.18.0-1
    /usr/share/bash-completion/ is owned by bubblewrap 0.13.1-1
    /usr/share/bash-completion/ is owned by cmake 4.4.5-1
    /usr/share/bash-completion/ is owned by colord 1.4.8-2
    /usr/share/bash-completion/ is owned by dconf 51.0-1
    /usr/share/bash-completion/ is owned by dkms 3.4.4-1
    /usr/share/bash-completion/ is owned by ethtool 1:7.2-1
    /usr/share/bash-completion/ is owned by fd 10.5.0-3
    /usr/share/bash-completion/ is owned by gimp 3.2.6-2
    /usr/share/bash-completion/ is owned by git 2.56.0-1
    /usr/share/bash-completion/ is owned by glib2 2.90.1-1
    /usr/share/bash-completion/ is owned by grub 2:2.16-1
    /usr/share/bash-completion/ is owned by gstreamer 1.28.8-1
    /usr/share/bash-completion/ is owned by gtk4 1:4.24.1-1
    /usr/share/bash-completion/ is owned by hwloc 2.15.0-1
    /usr/share/bash-completion/ is owned by i3lock-color 2.13.c.5-3.3
    .... # and so on
    

    It is the application developers, not the shell authors, who are responsible for preparing autocompletions for bash, fish, or zsh.
    But for some reason, they ignore pwsh.

  5. doctordns commented on Nov 1, 2026

    @doctordns
    Collaborator

    Seems to me, an "abbreviation" is just a function by another name. And with less functionality.

    I do not think this to be a hood addition yo PowerShell.

  6. sharpchen commented on Nov 1, 2026

    @sharpchen

    Abbr is more like a code snippet when editing. The inplace expansion has different scope than a function though

  7. mklement0 commented on Nov 1, 2026

    @mklement0
    Contributor

    Good finds on the duplicates, sharpchen (@sharpchen).

    To summarize:

  8. kilasuit commented on Nov 2, 2026

    @kilasuit
    Collaborator

    This is also something that I know Patrick Meinecke (@SeeminglyScience) & others have mentioned about wanting to look at adding more flexible "bash/git" like aliases that sorta meets at least 1 of the required parts to enable this request.

    Which I think possibly makes this a duplicate of, if not at least in alignment with this issue

    I think if that gets added then it very much would likely be a smaller addition in PSReadLine to support auto expansion of these new kind of aliased commands via ctrl+space but I think that only really works if there is a way to distinguish between what we have as Aliases today, and whatever it is that we call these new kinds as part of any possible implementation.

    But I do think this would need the initial work in the Engine to support.

  9. mklement0 commented on Nov 3, 2026

    @mklement0
    Contributor

    Ryan Yates (@kilasuit): #12962 is definitely not a duplicate, and while later building on it may be an option, it couldn't be used to faithfully implement the fish shell abbreviation feature being requested:


    That said, building on #12962 is possible if the functionality is tweaked / extended, thereby potentially abandoning parity with the fish feature:

    • Option A, which would deviate from the fish feature: Require opt-in to expansion (as effectively suggested in the initial post), by way of a special key chord

    • Option B, which would require an additional new engine feature but could be implemented as in fish: Expand the alias object model with an optional property that indicates whether a given alias should function like a fish abbrevation, i.e. should be expanded by pressing Spacebar or Enter (with the distinct behaviors detailed above). Said property would then have to be exposed via New-Alias and Set-Alias.

    Implementing #12962 and the potential additional alias property require engine support, building on them as discussed belongs in PSReadLine.


    All that said:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugNeeds-TriageThe issue is new and needs to be triaged by a work group.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions