Skip to content

Fish like abbreviations for auto expansion of aliases of command plus args #3279

Open

Description

@nebula-it

Prerequisites

  • Write a descriptive title.

Description of the new feature/enhancement

Currently, in pwsh if you want to make alias of a command + args you need to use a function. e.g

function kgpo() { & kubectl get pods $args }

However, the issue with this is that it breaks autocomplete. To get around this, can we have something similar to what fish does with abbreviations. In pwsh, we can do

New-Abbreviation -Name kgpo -Value 'kubectl get pods'

this will simply expand the chars kgpo as soon as those are typed, i.e once you type kgpo and hit space, and then standard autocomplete will take over if you hit tab.

It was discussed in #1753 previously but that issue got closed. PowerShell/PowerShell#12962 is another one from main powershell repo but as discussed, seems like this belongs to the realm of PSReadLine.

Proposed technical implementation details (optional)

No response

Activity

  1. ghost added
    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
    on Apr 18, 2022
  2. changed the title [-]Fish like abbreviations for aliases of command and args[/-] [+]Fish like abbreviations for auto expansion of aliases of command plus args[/+] on Apr 18, 2022
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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions