Skip to content

Powershell crash when dropping .bat file into VScode Powershell terminal #4772

@Fabimawn

Description

@Fabimawn

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

Empty powershell console when dropping in a batch file named: Backup source SSUpdaterTool.bat in Visual Code.

Powershell exception:
-----------------------------------------------------------------------     
Last 1 Keys:
 &

Exception:
System.ArgumentOutOfRangeException: De waarde moet groter zijn dan of gelijk zijn aan nul en minder zijn dan de buffergrootte van de console in die dimensie.
Parameternaam: left
Werkelijke waarde was -2.
   bij System.Console.SetCursorPosition(Int32 left, Int32 top)
   bij Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
   bij Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   bij Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   bij Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   bij Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   bij Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)       
   bij Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   bij Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)      
-----------------------------------------------------------------------



Visual code info:
Version: 1.99.0
Commit: 4437686ffebaf200fa4a6e6e67f735f3edf24ada
Date: 2025-04-02T21:35:19.530Z
Electron: 34.3.2
ElectronBuildId: 11161073
Chromium: 132.0.6834.210
Node.js: 20.18.3
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.19045

Screenshot

Image

Environment data

PS Version: 5.1.19041.5848
PS HostName: ConsoleHost
PSReadLine Version: 2.0.0-beta2       
PSReadLine EditMode: Windows
OS: 10.0.19041.320 (WinBuild.160101.0800)
BufferWidth: 38
BufferHeight: 13

Steps to reproduce

Stated in exception report.

Expected behavior

The file name appearing in the console, so I can press enter to run it.

Actual behavior

Crashes the moment I drop the batch file into the powershell terminal from the VScode file tree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions