Skip to content

Buggy output in PowerShell whilst using Python Virtual environment #4824

@Dhavamanee

Description

@Dhavamanee

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

### Exception

System.IO.IOException: The parameter is incorrect.
   at System.ConsolePal.SetWindowPosition(Int32 left, Int32 top)
   at Microsoft.PowerShell.PSConsoleReadLine.ScrollDisplayUp(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken, Nullable`1 lastRunStatus)

Screenshot

Lemme share my background and bit of context relevant to this:
I did not major in computer science, IT or even electronics for that matter. So I lack the technical expertise necessary to discuss this stuff in detail. Please bear with me if you find it too verbose and not to the point.

Context:
I have been learning python programming language for sometime and is relatively new to PowerShell. I am learning it with the help of "Learn Python the hard way!" written by Zed A. Shaw. I am mentioning it because my knowledge on PowerShell doesn't go much beyond the crash course at the end of the book. The book was designed in such a way that the learners must type in their code in something like Notepad++ and run it using PowerShell. I have recently upgraded to version 7 of PowerShell and is indeed convenient. After upgrading, I happen to begin my exercises on basic Skeleton directory and learnt to create virtual environments. Recently, I have been testing codes with nose2. So far, so good. However, when I pressed PgUp, PgDn to scroll (while a virtual environment was active), I got a buggy output. I am specifically mentioning the virtual environment thing because I just deactivated the virtual environment and seems too work fine when I press PgUp or PgDn to scroll.

I have been asked by Shell to report it and I did. I hope that it gets fixed. I wouldn't call it a serious bug as my computer didn't crash(Thankfully) and can continue using PowerShell but it's kinda annoying. Hope that it gets fixed.

Environment data

### Environment
PSReadLine: 2.3.6+d2e770f93b7a53d8660a6402eb29d1ae1c35e767
PowerShell: 7.5.1
OS: Microsoft Windows 10.0.19045
BufferWidth: 168
BufferHeight: 9001

Steps to reproduce

Activate a python virtual environment and press PgUp or PgDn. If you didn't get buggy output, try running nose2 tests on simple programs and then try again.
Edit: I unfortunately couldn't reproduce it but will let you know if I find it again.

Expected behavior

Pressing PgUp or PgDn should only scroll up or down(respectively). It works fine with Global environment but not in Virtual Environment.

Actual behavior

The buggy output as you can see in my upload. I copy pasted it in notepad, saved it and uploaded it for for reference.

PowerShell bug.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions