Skip to content

$env:+<TAB> doesn't work in emacs mode #126

Closed

Description

@vors

Repro:
type "$env:"+TAB

Expected:
string "$env:" preserves on the line,
completion variants have been offered

Actual:
string reduced to "$"
No completion offered
short noize in headphones

Activity

  1. vors commented on Jun 21, 2014

    @vors
    ContributorAuthor

    Hi Keith,

    I just verified it on another machine with fresh installation of 1.0.0.8
    (which is current version in PSGet gallery).
    Did you set "Emacs" mode (Set-PSReadlineOption -EditMode Emacs)?
    It works fine in "Windows mode"

    Here is output:
    Windows PowerShell
    Copyright (C) 2013 Microsoft Corporation. All rights reserved.

    PS C:\WINDOWS\system32> Install-Module psreadline
    Module PSReadLine was successfully installed.
    C:\Users\sevoroby\Documents\WindowsPowerShell\Modules\PSReadLine
    PS C:\WINDOWS\system32> Get-Module PSReadLine

    ModuleType Version Name ExportedCommands


    Script 1.0.0.8 PSReadLine
    {Get-PSReadlineKeyHandler, Get-PSReadlineOption, Set-PSRea...

    PS C:\WINDOWS\system32> Set-PSReadlineOption -EditMode Emacs
    PS C:\WINDOWS\system32> $^C
    PS C:\WINDOWS\system32>

    On Fri, Jun 20, 2014 at 7:07 PM, Keith Hill notifications@github.com
    wrote:

    What version? I can't repro this on 1.0.0.8 or 1.0.0.11.

    —
    Reply to this email directly or view it on GitHub
    #126 (comment).

  2. rkeithhill commented on Jun 21, 2014

    @rkeithhill
    Contributor

    Sorry, I jumped the gun. I don't see the problem in "Windows" EditMode. I don't use the Emacs mode.

  3. n8v commented on Jan 30, 2015

    @n8v

    👍

    I am so happy to have PSReadLine but this is broken—when I hit tab it deletes everything back to the $:

    psreadline tab rage

  4. lzybkr commented on Jan 30, 2015

    @lzybkr
    Contributor

    Yes, I know it's broken, but there is a good explanation why. The common prefix for all of the completions is '$' because one of the completions requires curly braces: ${env:ProgramFiles(x86)}.

    I wanted to avoid interpreting the completions, which in this case would mean adding braces to all of the other completions. But the problem goes beyond variables.

    Maybe I should just go straight to MenuComplete when the common unambiguous prefix is shorter word to complete.

  5. n8v commented on Jan 30, 2015

    @n8v

    FWIW the exact thing I was trying to do when it came to my attention was to get it to show me the right way to spell/escape/quote ${env:ProgramFiles(x86)} without googling it. Without PSReadline, it does if I keep tabbing...

  6. lzybkr commented on Jan 30, 2015

    @lzybkr
    Contributor

    Until this is fixed, I suggest using Ctrl+Space.

    If you forget and hit tab, remember that you can undo (Ctrl+_ in emacs mode, Ctrl+z in Windows mode), then hit Ctrl+Space.

  7. n8v commented on Jan 30, 2015

    @n8v

    Thanks a lot for your attention and quick workaround.

  8. lzybkr commented on Nov 12, 2017

    @lzybkr
    Contributor

    I think this was fixed in #515 - at any rate, it doesn't repro anymore.

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-BugIt either shouldn't be doing this or needs an investigation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions