Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Powershell/Debugpy exception #4238

Closed
3 tasks done
bjorkelundflyhau opened this issue Oct 23, 2024 · 1 comment
Closed
3 tasks done

Powershell/Debugpy exception #4238

bjorkelundflyhau opened this issue Oct 23, 2024 · 1 comment

Comments

@bjorkelundflyhau
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 200 Keys:
 o n . d e b u g p y - 2 0 2 4 . 1 2 . 0 - w i n 3 2 - x 6 4 \ b u n d l e d \ l i b s \ d 
e b u g p y \ a d a p t e r / . . / . . \ d e b u g p y \ l a u n c h e r ' Space ' 5 7 9 5 7 ' Space ' - - ' Space ' C : \ U s e r s \ Ø y v i n d B j ø r k e l u n d \ O n e D r i 
v e Space - Space L U F T H A V N D R I F T Space A S \ D o k u m e n t e r \ P r o s j e k t e r \ P y t h o n \ L P P M \ h i l o g a m e . p y ' Space Enter


Exception:
System.ArgumentOutOfRangeException: Verdien må være større enn eller lik null, og mindre enn konsollens bufferstørrelse i den dimensjonen.
Parameternavn: left
Den faktiske verdien var -1.
   ved System.Console.SetCursorPosition(Int32 left, Int32 top)
   ved Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
   ved Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   ved Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   ved Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   ved Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)       
   ved Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   ved Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   ved Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics 
engineIntrinsics)
-----------------------------------------------------------------------
PS C:\Users\ØyvindBjørkelund\OneDrive - LUFTHAVNDRIFT AS\Dokumenter\Prosjekter\Python\LPPM>

Screenshot

debugerror

Environment data

PS Version: 5.1.19041.5007
PS HostName: ConsoleHost
PSReadLine Version: 2.0.0-beta2
PSReadLine EditMode: Windows
OS: 10.0.19041.1 (WinBuild.160101.0800)
BufferWidth: 107
BufferHeight: 20

Steps to reproduce

low = 1
high = 1000

print("Please think of a number between {} and {}".format(low, high))
input ("Press ENTER to start")

guesses = 1
while low != high:
# print("\tGuessing in the range of {} and {}".format(low, high))
guess = low + (high - low) // 2
high_low = input("My guess is {}.\n Should i guess higher or lower?\n "
"Enter h or l, or c if my guess was correct: "
.format(guess).casefold())

if high_low == "h":
    # Guess higher. The low end of the range becomes 1 greater than the guess.
    low = guess + 1
elif high_low == "l":
    # Guess lower. The high end of the range becomes one less than the guess.
    high = guess - 1
elif high_low == "c":
    print("I got it in {} guesses".format(guesses))
    break
else:
    print("Please enter h, l or c")

guesses = guesses + 1

else:
print("You thought of the number {}".format(low))
print("I got it in {} guesses".format(guesses))

Expected behavior

Debugging of a .py file

Actual behavior

The above exception happens.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Oct 23, 2024
Copy link

This issue was already fixed (see #1306). Please upgrade to the 2.3.5 version of PSReadLine from PowerShell Gallery.
See the upgrading section for instructions. Please let us know if you run into the same issue with the latest version.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant