Skip to content

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

@esmayhan

Description

@esmayhan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions