PowerShell / PSReadLine

A bash inspired readline implementation for PowerShell
BSD 2-Clause "Simplified" License
3.73k stars 295 forks source link

Oops, something went wrong. Please report this bug with the details below. #1401

Closed lolamnma closed 4 years ago

lolamnma commented 4 years ago

Hi, this is the first time I have done something like this so sorry if I am doing anything wrong :). I am creating a program to basically press hotkeys so I can control Streamlabs OBS but every time I run either the keyboard module or pyautogui I get the same error. I believe it has something to do with my IDLE (it being Visual Studio Code) but not sure. Below is the error message that I always recieve:

Last 5 Keys: & Space C : /

Exception: System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension. Parameter name: left Actual value was -1. at System.Console.SetCursorPosition(Int32 left, Int32 top) at Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value) at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor) at Microsoft.PowerShell.PSConsoleReadLine.ForceRender() at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c) at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable1 key, Object arg) at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg) at Microsoft.PowerShell.PSConsoleReadLine.InputLoop() at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

PS C:\Users\lolamnma\Documents\School Work\Computer Science\Python Project SLOBSRC\Code> Users/lolamnma/AppData/Local/Programs/Python/Python38-32/python.exe "c:/Users/lolamnma/Documents/School Work/Computer Science/Python Project SLOBSRC/Code/test.py" Users/lolamnma/AppData/Local/Programs/Python/Python38-32/python.exe : The term 'Users/lolamnma/AppData/Local/Programs/Python/Python38-32/python.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

iSazonov commented 4 years ago

See https://github.com/PowerShell/PSReadLine/issues/1306

lolamnma commented 4 years ago

Hi, I hardly ever use powershell or cmd so I'm a bit confused when trying to update PSReadLine. I am running the command that it is telling me to run: powershell -noprofile -command "Install-Module PSReadLine -Force -SkipPublisherCheck -AllowPrerelease" but it says WARNING: The version '2.0.0' of module 'PSReadline' is currently in use. Retry the operation after closing the applications.. I'm looking at the upgrade guide and it says `If you get an error like:

Remove-Item : Cannot remove item C:\Users{yourName}\Documents\WindowsPowerShell\Modules\PSReadLine\Microsoft.PowerShell.PSReadLine.dll: Access to the path 'C:\Users{yourName}\Documents\WindowsPowerShell\Modules\PSReadLine\Microsoft.PowerShell.PSReadLine.dll' is denied. or a warning like:

WARNING: The version '2.0.0' of module 'PSReadLine' is currently in use. Retry the operation after closing the applications. Then you didn't kill all the processes that loaded PSReadLine`.

But I have no idea how to kill all the process that have loaded it. Any advice would be greatly appreciated, thank you.

iSazonov commented 4 years ago

You could save the module with Save-Module and then manually replace current module.

VectorBCO commented 4 years ago

I moved psreadline\2.0.0 folder with closed powershell and install it back with install-module cmdlet

daxian-dbw commented 4 years ago

Thanks for the reporting! From the bug report template:

The maintainer may close your issue without further explanation or engagement if:
- You delete this entire template and go your own path;

So, please follow the bug report template to provide environment data and repro steps the next time.

When updating PSReadLine, make sure you close all powershell/pwsh instances and run powershell -noprofile -command "Install-Module PSReadLine -Force -SkipPublisherCheck -AllowPrerelease from cmd.exe.