Buggy output in PowerShell whilst using Python Virtual environment

未关闭
#4,824 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
csharp, powershell, python
领域
cli, tooling

调研方向

Start by reproducing the reported PgUp/PgDn behavior on Windows 10 with PowerShell 7.5.1, PSReadLine 2.3.6, and an active Python virtual environment. Trace the reported ScrollDisplayUp and InputLoop entry points; done means PgUp and PgDn scroll normally without the System.IO.IOException or buggy output.

由索引模型根据 Issue 内容生成。

描述

Needs-Attention :wave:
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

主要语言
C#
星标
4.4k
派生
341
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PowerShell/PSReadLine 的其他 Issue

查看 PowerShell/PSReadLine 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。