Skip to content

PSReadLine: '&' karakteri girildiğinde System.ArgumentOutOfRangeException: left -2 hatası #4702

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

Closed
3 tasks done
esmayhan opened this issue Apr 12, 2025 · 1 comment
Closed
3 tasks done

Comments

@esmayhan
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 1 Keys:
 &

Exception:
System.ArgumentOutOfRangeException: Değer sıfırdan büyük veya eşit ve bu boyuttaki konsolun arabellek boyutundan küçük olmalıdır.
Parametre adı: left
Gerçek değer -2 idi.
    konum: System.Console.SetCursorPosition(Int32 left, Int32 top)
    konum: Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
    konum: Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaul    konum: Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
    konum: Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
    konum: Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
    konum: Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
    konum: Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
    konum: Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------

Screenshot

N/A

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.19041.5607
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.5607
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Name    : PSReadline
Version : 2.0.0


Version : 5.1.19041.5607

C:\Users\Pc\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules

IsSingleByte      : True
BodyName          : ibm857
EncodingName      : Türkçe (DOS)
HeaderName        : ibm857
WebName           : ibm857
WindowsCodePage   : 1254
IsBrowserDisplay  : False
IsBrowserSave     : False
IsMailNewsDisplay : False
IsMailNewsSave    : False
EncoderFallback   : System.Text.InternalEncoderBestFitFallback
DecoderFallback   : System.Text.InternalDecoderBestFitFallback
IsReadOnly        : True
CodePage          : 857

Steps to reproduce

At line:1 char:1

  • &
  • ~
    Missing expression after '&' in pipeline element.
    • CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
    • FullyQualifiedErrorId : MissingExpression

Expected behavior

PowerShell'de "&" karakteri girildiğinde herhangi bir hata mesajı görüntülenmemelidir. İmleç bir sonraki karaktere geçmeli ve kullanıcının komut yazmaya devam etmesine izin verilmelidir.

Aşağıdaki PowerShell komut dosyası çalıştırıldığında:

Write-Host "Merhaba Dünya"
&
Ekranda sadece "Merhaba Dünya" mesajı görüntülenmeli ve herhangi bir hata mesajı görüntülenmemelidir.

### Actual behavior

PowerShell'de "&" karakteri girildiğinde, aşağıdaki hata mesajı görüntüleniyor ve komut istemi kilitleniyor:

System.ArgumentOutOfRangeException: Değer sıfırdan büyük veya eşit ve bu boyuttaki konsolun arabellek boyutundan küçük olmalıdır.
Parametre adı: left
Gerçek değer -2 idi.

Bu hata, kullanıcının komut girmeye devam etmesini engelliyor ve PowerShell'i yeniden başlatmayı gerektiriyor.

Aşağıdaki PowerShell komut dosyası çalıştırıldığında:

```powershell
Write-Host "Merhaba Dünya"
&
Ekranda "Merhaba Dünya" mesajı görüntülenmiyor ve aşağıdaki hata mesajı görüntüleniyor:

System.ArgumentOutOfRangeException: ...

Bu hata, komut dosyasının çalışmasını durduruyor ve kullanıcının beklenen çıktıyı görmesini engelliyor.
@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 Apr 12, 2025
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 Apr 12, 2025
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