question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tab completion fails in some cases; Cursor drops back to parent folder.

See original GitHub issue

I have a test case where I can reproduce the issue. Unfortunately, It happens to be a directory full of code that I don’t, yet, have rights to release. I have not been able to isolate the exact scenario that causes the issue, thus I have not been able to reproduce this issue in a controlled circumstance.

The parent path of the folder that I’m currently experiencing problems with resides under C:\Program Files\WindowsPowerShell\Modules\.

Update: I’ve come up with a full test case. It appears that it’s related to a hidden dotfile in the directory with a large ammount of the name matching another file. This commonly happens with Vim, as it creates “.swp” files in this way as it’s working on a file.

Steps to reproduce:

  1. Create a file structure to recreate the problem:

    1. Make the parent directory:
    cd ~
    New-Item -Type Directory -Path tmp\PSReadLine_260
    cd tmp\PSReadLine_260
    
    1. Create some test files in the directory.
    New-Item -Type File -Path testFileOne.txt
    New-Item -Type File -Path testFileTwo.txt
    New-Item -Type File -Path testFileThree.txt
    
    1. Create the file that will break tab completion (note the dot at the beginning).
    New-Item -Type File -Path .testFileOne.txt
    attrib +H .testFileOne.txt
    
  2. Enter gc t

  3. Press the Tab key

Expected behavior: The resultant command line should read: > gc .\testFile

Actual behavior: The resultant command line reads: > gc .\

Typing enough of the file name will cause completion to function properly. gc testFi<Tab> will result in: gc .\ gc testFil<Tab> will result in: gc .\testFile

Without knowing the codebase, this makes me wonder if there’s a Compare-Object occurring with a SyncWindow size that’s too small.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
lzybkrcommented, Dec 3, 2017

Please try a recent build, e.g. this one, there have been improvements in the handling of ambiguous completions.

I haven’t looked at why completing ./README.md<TAB> returns .README.md.swp, but PSReadLine does not generate completions, PowerShell does that so that all hosts can benefit (e.g. ISE, VSCode, PSReadLine, etc.)

And no worries about appearing inactive - I get busy with other things, this is a side project for me. The version in the PowerShell tree is a fork that only works for PowerShell Core - this version supports Windows PowerShell and now PowerShell Core.

0reactions
bgshacklettcommented, Dec 3, 2017

Hmm, it looks that way, yes. I’ll go ahead and close this issue in favor of #183 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to move all files in subfolders to a parent folder? [closed]
Make a selection of the files and folders you want to move. Right click, choose cut; Go to the parent folder; Right Click...
Read more >
Error List stops updating after exception of type ...
Another work around is to ignore the red squiggly error indicators and Error List… and just use the errors logged by the compiler...
Read more >
Backspace, Tab, Del and arrow keys not working in ...
When I ssh into another Ubuntu machine with my account (with sudo permissions), my backspace key generates some awkward symbols on pressing.
Read more >
Code completion | WebStorm Documentation
To show you completion suggestions, WebStorm goes through the project files with the source code and adds classes, methods, functions, and ...
Read more >
lf
lf is a terminal file manager. Source code can be found in the repository at https://github.com/gokcehan/lf. This documentation can either be read from ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found