Skip to content

System.ArgumentOutOfRangeException: 该值必须大于或等于零,且必须小于控制台缓冲区在该维度的大小。 #5143

Description

@2172635904

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

哎呀,出现问题。请在报告此 Bug 时添加以下详细信息。
在 GitHub 上报告: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
上 1 个密钥:
 &

异常:
System.ArgumentOutOfRangeException: 该值必须大于或等于零,且必须小于控制台缓冲区在该维度的大小。
参数名: left
实际值是 -2。
   在 System.Console.SetCursorPosition(Int32 left, Int32 top)
   在 Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
   在 Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   在 Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   在 Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   在 Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   在 Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   在 Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
PS C:\Users\21726\Desktop\123> & D:/python3.9.13/python.exe c:/Users/21726/Desktop/123/1.py
{
    "acc": "0",
    "gapps": "1",
    "Serialno": "",
    "mmuid": "",
    "isRoot": "0",
    "screen": "720x1544",
    "device_type": "android",
    "hw": "bad66bc55598d11eff31246014c99c87",
    "osversion_int": "28",
    "RAMSize": "3824400",
    "password": "",
    "current_wifi": "02:00:00:00:00:00",
    "model": "PDBM00",
    "lat": "0",
    "androidId": "be0674ffa006f391",
    "_uid_": "9708226442d12a076e26b85afc51d44a",
    "phone_type": "CDMA",
    "lng": "0",
    "CpuInfo": "0-7",
    "MacInfo": "02:00:00:00:00:00",
    "utdid": "DVxv0cRSEQVVwmK24FZSZYfN",
    "_iid": "f64905d46be6cf1d7719ea030bae5cd9",
    "version": "9565",
    "apksign": "4f3a531caff3e37c278659cc78bfaecc",
    "_net_": "wifi",
    "KernelVersion": "",
    "router_mac": "02:00:00:00:00:00",
    "network_class": "wifi",
    "SerialNumber": "IUXV42PV9N89OENR",
    "smscode": "123456",
    "sensorNames": "G1$T1$L1$A1$M1$D1$W0$P0$Qe0$vb0$1$2c51857ff32ea2ff96a80d7e1004d6e5",
    "BootSerialno": "",
    "buildnumber": "PPR1.180610.011/1641904128",
    "imsi": "unknown",
    "emu": "04f776dd01a654bf8ed1cccfc3ef09cc",
    "mac": "02:00:00:00:00:00",
    "manufacture": "OPPO",
    "rom": "9",
    "uid": "9708226442d12a076e26b85afc51d44a",
    "BaseBandVersion": "",
    "market_source": "14",
    "etype": "2",
    "oaid": "57525987-fb75-e4c5-c326-aa2a45720bec",
    "phone_netWork": "0",
    "dpp": "d41c29e38a598687133c03b9ec8bde22",
    "bindSource": "bind_source_login",
    "_uidType": "androidid",
    "imei": "0123897077241",
    "account": "+8613800138000"
}

Screenshot

哎呀,出现问题。请在报告此 Bug 时添加以下详细信息。
在 GitHub 上报告: https://github.com/lzybkr/PSReadLine/issues/new

上 1 个密钥:
&

异常:
System.ArgumentOutOfRangeException: 该值必须大于或等于零,且必须小于控制台缓冲区在该维度的大小。
参数名: left
实际值是 -2。
在 System.Console.SetCursorPosition(Int32 left, Int32 top)
在 Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
在 Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
在 Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
在 Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable1 key, Object arg) 在 Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
在 Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
在 Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

PS C:\Users\21726\Desktop\123> & D:/python3.9.13/python.exe c:/Users/21726/Desktop/123/1.py
{
"acc": "0",
"gapps": "1",
"Serialno": "",
"mmuid": "",
"isRoot": "0",
"screen": "720x1544",
"device_type": "android",
"hw": "bad66bc55598d11eff31246014c99c87",
"osversion_int": "28",
"RAMSize": "3824400",
"password": "",
"current_wifi": "02:00:00:00:00:00",
"model": "PDBM00",
"lat": "0",
"androidId": "be0674ffa006f391",
"uid": "9708226442d12a076e26b85afc51d44a",
"phone_type": "CDMA",
"lng": "0",
"CpuInfo": "0-7",
"MacInfo": "02:00:00:00:00:00",
"utdid": "DVxv0cRSEQVVwmK24FZSZYfN",
"_iid": "f64905d46be6cf1d7719ea030bae5cd9",
"version": "9565",
"apksign": "4f3a531caff3e37c278659cc78bfaecc",
"net": "wifi",
"KernelVersion": "",
"router_mac": "02:00:00:00:00:00",
"network_class": "wifi",
"SerialNumber": "IUXV42PV9N89OENR",
"smscode": "123456",
"sensorNames": "G1$T1$L1$A1$M1$D1$W0$P0$Qe0$vb0$1$2c51857ff32ea2ff96a80d7e1004d6e5",
"BootSerialno": "",
"buildnumber": "PPR1.180610.011/1641904128",
"imsi": "unknown",
"emu": "04f776dd01a654bf8ed1cccfc3ef09cc",
"mac": "02:00:00:00:00:00",
"manufacture": "OPPO",
"rom": "9",
"uid": "9708226442d12a076e26b85afc51d44a",
"BaseBandVersion": "",
"market_source": "14",
"etype": "2",
"oaid": "57525987-fb75-e4c5-c326-aa2a45720bec",
"phone_netWork": "0",
"dpp": "d41c29e38a598687133c03b9ec8bde22",
"bindSource": "bind_source_login",
"_uidType": "androidid",
"imei": "0123897077241",
"account": "+8613800138000"
}

Environment data

上 1 个密钥:
 &

异常:
System.ArgumentOutOfRangeException: 该值必须大于或等于零,且必须小于控制台缓冲区在该维度的大小。
参数名: left
实际值是 -2。
   在 System.Console.SetCursorPosition(Int32 left, Int32 top)
   在 Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
   在 Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   在 Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   在 Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   在 Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   在 Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   在 Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

Steps to reproduce

哎呀,出现问题。请在报告此 Bug 时添加以下详细信息。
在 GitHub 上报告: https://github.com/lzybkr/PSReadLine/issues/new

上 1 个密钥:
&

异常:
System.ArgumentOutOfRangeException: 该值必须大于或等于零,且必须小于控制台缓冲区在该维度的大小。
参数名: left
实际值是 -2。
在 System.Console.SetCursorPosition(Int32 left, Int32 top)
在 Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
在 Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
在 Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
在 Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable1 key, Object arg) 在 Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
在 Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
在 Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

PS C:\Users\21726\Desktop\123> & D:/python3.9.13/python.exe c:/Users/21726/Desktop/123/1.py
{
"acc": "0",
"gapps": "1",
"Serialno": "",
"mmuid": "",
"isRoot": "0",
"screen": "720x1544",
"device_type": "android",
"hw": "bad66bc55598d11eff31246014c99c87",
"osversion_int": "28",
"RAMSize": "3824400",
"password": "",
"current_wifi": "02:00:00:00:00:00",
"model": "PDBM00",
"lat": "0",
"androidId": "be0674ffa006f391",
"uid": "9708226442d12a076e26b85afc51d44a",
"phone_type": "CDMA",
"lng": "0",
"CpuInfo": "0-7",
"MacInfo": "02:00:00:00:00:00",
"utdid": "DVxv0cRSEQVVwmK24FZSZYfN",
"_iid": "f64905d46be6cf1d7719ea030bae5cd9",
"version": "9565",
"apksign": "4f3a531caff3e37c278659cc78bfaecc",
"net": "wifi",
"KernelVersion": "",
"router_mac": "02:00:00:00:00:00",
"network_class": "wifi",
"SerialNumber": "IUXV42PV9N89OENR",
"smscode": "123456",
"sensorNames": "G1$T1$L1$A1$M1$D1$W0$P0$Qe0$vb0$1$2c51857ff32ea2ff96a80d7e1004d6e5",
"BootSerialno": "",
"buildnumber": "PPR1.180610.011/1641904128",
"imsi": "unknown",
"emu": "04f776dd01a654bf8ed1cccfc3ef09cc",
"mac": "02:00:00:00:00:00",
"manufacture": "OPPO",
"rom": "9",
"uid": "9708226442d12a076e26b85afc51d44a",
"BaseBandVersion": "",
"market_source": "14",
"etype": "2",
"oaid": "57525987-fb75-e4c5-c326-aa2a45720bec",
"phone_netWork": "0",
"dpp": "d41c29e38a598687133c03b9ec8bde22",
"bindSource": "bind_source_login",
"_uidType": "androidid",
"imei": "0123897077241",
"account": "+8613800138000"
}

Expected behavior

哎呀,出现问题。请在报告此 Bug 时添加以下详细信息。
在 GitHub 上报告: https://github.com/lzybkr/PSReadLine/issues/new

上 1 个密钥:
&

异常:
System.ArgumentOutOfRangeException: 该值必须大于或等于零,且必须小于控制台缓冲区在该维度的大小。
参数名: left
实际值是 -2。
在 System.Console.SetCursorPosition(Int32 left, Int32 top)
在 Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
在 Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
在 Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
在 Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable1 key, Object arg) 在 Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
在 Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
在 Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

PS C:\Users\21726\Desktop\123> & D:/python3.9.13/python.exe c:/Users/21726/Desktop/123/1.py
{
"acc": "0",
"gapps": "1",
"Serialno": "",
"mmuid": "",
"isRoot": "0",
"screen": "720x1544",
"device_type": "android",
"hw": "bad66bc55598d11eff31246014c99c87",
"osversion_int": "28",
"RAMSize": "3824400",
"password": "",
"current_wifi": "02:00:00:00:00:00",
"model": "PDBM00",
"lat": "0",
"androidId": "be0674ffa006f391",
"uid": "9708226442d12a076e26b85afc51d44a",
"phone_type": "CDMA",
"lng": "0",
"CpuInfo": "0-7",
"MacInfo": "02:00:00:00:00:00",
"utdid": "DVxv0cRSEQVVwmK24FZSZYfN",
"_iid": "f64905d46be6cf1d7719ea030bae5cd9",
"version": "9565",
"apksign": "4f3a531caff3e37c278659cc78bfaecc",
"net": "wifi",
"KernelVersion": "",
"router_mac": "02:00:00:00:00:00",
"network_class": "wifi",
"SerialNumber": "IUXV42PV9N89OENR",
"smscode": "123456",
"sensorNames": "G1$T1$L1$A1$M1$D1$W0$P0$Qe0$vb0$1$2c51857ff32ea2ff96a80d7e1004d6e5",
"BootSerialno": "",
"buildnumber": "PPR1.180610.011/1641904128",
"imsi": "unknown",
"emu": "04f776dd01a654bf8ed1cccfc3ef09cc",
"mac": "02:00:00:00:00:00",
"manufacture": "OPPO",
"rom": "9",
"uid": "9708226442d12a076e26b85afc51d44a",
"BaseBandVersion": "",
"market_source": "14",
"etype": "2",
"oaid": "57525987-fb75-e4c5-c326-aa2a45720bec",
"phone_netWork": "0",
"dpp": "d41c29e38a598687133c03b9ec8bde22",
"bindSource": "bind_source_login",
"_uidType": "androidid",
"imei": "0123897077241",
"account": "+8613800138000"
}

Actual behavior

哎呀,出现问题。请在报告此 Bug 时添加以下详细信息。
在 GitHub 上报告: https://github.com/lzybkr/PSReadLine/issues/new

上 1 个密钥:
&

异常:
System.ArgumentOutOfRangeException: 该值必须大于或等于零,且必须小于控制台缓冲区在该维度的大小。
参数名: left
实际值是 -2。
在 System.Console.SetCursorPosition(Int32 left, Int32 top)
在 Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
在 Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
在 Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
在 Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable1 key, Object arg) 在 Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
在 Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
在 Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

PS C:\Users\21726\Desktop\123> & D:/python3.9.13/python.exe c:/Users/21726/Desktop/123/1.py
{
"acc": "0",
"gapps": "1",
"Serialno": "",
"mmuid": "",
"isRoot": "0",
"screen": "720x1544",
"device_type": "android",
"hw": "bad66bc55598d11eff31246014c99c87",
"osversion_int": "28",
"RAMSize": "3824400",
"password": "",
"current_wifi": "02:00:00:00:00:00",
"model": "PDBM00",
"lat": "0",
"androidId": "be0674ffa006f391",
"uid": "9708226442d12a076e26b85afc51d44a",
"phone_type": "CDMA",
"lng": "0",
"CpuInfo": "0-7",
"MacInfo": "02:00:00:00:00:00",
"utdid": "DVxv0cRSEQVVwmK24FZSZYfN",
"_iid": "f64905d46be6cf1d7719ea030bae5cd9",
"version": "9565",
"apksign": "4f3a531caff3e37c278659cc78bfaecc",
"net": "wifi",
"KernelVersion": "",
"router_mac": "02:00:00:00:00:00",
"network_class": "wifi",
"SerialNumber": "IUXV42PV9N89OENR",
"smscode": "123456",
"sensorNames": "G1$T1$L1$A1$M1$D1$W0$P0$Qe0$vb0$1$2c51857ff32ea2ff96a80d7e1004d6e5",
"BootSerialno": "",
"buildnumber": "PPR1.180610.011/1641904128",
"imsi": "unknown",
"emu": "04f776dd01a654bf8ed1cccfc3ef09cc",
"mac": "02:00:00:00:00:00",
"manufacture": "OPPO",
"rom": "9",
"uid": "9708226442d12a076e26b85afc51d44a",
"BaseBandVersion": "",
"market_source": "14",
"etype": "2",
"oaid": "57525987-fb75-e4c5-c326-aa2a45720bec",
"phone_netWork": "0",
"dpp": "d41c29e38a598687133c03b9ec8bde22",
"bindSource": "bind_source_login",
"_uidType": "androidid",
"imei": "0123897077241",
"account": "+8613800138000"
}

Activity

  1. xiaoyiming123 commented on May 10, 2026

    @xiaoyiming123

    I meet the bug too

  2. xiaoyiming123 commented on May 10, 2026

    @xiaoyiming123

    Why Chinese? Is it only happened on Chinese (Simplified) (简体中文) Language Pack for Visual Studio Code

  3. xiaoyiming123 commented on May 10, 2026

    @xiaoyiming123

    I met the bug over 3 times.

    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> D:\\P5391.exe
    #include <bits/stdc++.h>
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> using namespace std;
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> 
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> vector<int> t[20005], dp[20005];
    vector<int> : 无法将“vector<int>”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
    + vector<int> t[20005], dp[20005];
    + ~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (vector<int>:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> int fa[20005], sz[20005], son[20005], X[20005], Y[20005], res[20005], V, tot;
    int : 无法将“int”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
    + int fa[20005], sz[20005], son[20005], X[20005], Y[20005], res[20005], ...
    + ~~~
        + CategoryInfo          : ObjectNotFound: (int:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> 
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> void dfs(int u) {
    >>     sz[u] = 1;
    >>     for (int v : t[u]) {
    >>         dfs(v);
    >>         sz[u] += sz[v];
    >>         if (!son[u] || sz[son[u]] < sz[v]) son[u] = v;
    >>     }
    >> }
    所在位置 行:6 字符: 21
    +                     ~~
    标记“||”不是此版本中的有效语句分隔符。
    所在位置 行:6 字符: 35
    +         if (!son[u] || sz[son[u]] < sz[v]) son[u] = v;
    +                                   ~
    “<”运算符是为将来使用而保留的。
    所在位置 行:6 字符: 42
    +         if (!son[u] || sz[son[u]] < sz[v]) son[u] = v;
    +                                          ~
    if(条件)后面缺少语句块。
        + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : InvalidEndOfLine
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> 
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> void dfs2(int u) {
    >>     if (u) {
    >>         dp[u] = dp[fa[u]];
    >>             dp[u][i] = max(dp[u][i], dp[u][i - X[u]] + Y[u]);
    >>         }
    >>         if (u == son[fa[u]]) dp[fa[u]] = vector<int>();
    >>     } else dp[u].resize(V + 1);
    >>     res[u] = dp[u][V];
    >>     if (t[u].size()) {
    >>         for (int v : t[u]) {
    >>             if (v != son[u]) dfs2(v);
    >>         }
    >>         dfs2(son[u]);
    >>     } else {
    >>         dp[u] = vector<int>();
    >>     }
    >> }
    所在位置 行:4 字符: 30
    +         for (int i = X[u]; i <= V; i ++) {
    +                              ~
    “<”运算符是为将来使用而保留的。
    所在位置 行:5 字符: 36
    +             dp[u][i] = max(dp[u][i], dp[u][i - X[u]] + Y[u]);
    +                                    ~
    参数列表中缺少参量。
    所在位置 行:7 字符: 28
    +         if (u == son[fa[u]]) dp[fa[u]] = vector<int>();
    +                            ~
    if(条件)后面缺少语句块。
    所在位置 行:7 字符: 54
    +         if (u == son[fa[u]]) dp[fa[u]] = vector<int>();
    +                                                      ~
    “(”后面应为表达式。
    所在位置 行:8 字符: 11
    +     } else dp[u].resize(V + 1);
    +           ~
    “else”关键字后面缺少语句块。
    所在位置 行:10 字符: 19
    +                   ~
    “(”后面应为表达式。
    所在位置 行:12 字符: 28
    +             if (v != son[u]) dfs2(v);
    +                            ~
    if(条件)后面缺少语句块。
    所在位置 行:16 字符: 29
    +         dp[u] = vector<int>();
    +                             ~
        + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : RedirectionNotSupported
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> 
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> void dfs3(int u) {
    >>     if (u) {
    >>         -- tot;
    >>         cout << res[u] << '\n';
    >>     }
    >>     if (t[u].empty()) return;
    >>     for (int v : t[u]) dfs3(v);
    >>     -- tot;
    >>     if (tot >= 0) cout << res[u] << '\n';
    >> }
    所在位置 行:3 字符: 11
    +         -- tot;
    +           ~
    一元运算符“--”后面缺少表达式。
    所在位置 行:3 字符: 12
    +         -- tot;
    +            ~~~
    表达式或语句中包含意外的标记“tot”。
    所在位置 行:4 字符: 15
    +         cout << res[u] << '\n';
    +               ~
    重定向运算符后面缺少文件规范。
    所在位置 行:4 字符: 14
    +         cout << res[u] << '\n';
    +              ~
    “<”运算符是为将来使用而保留的。
    所在位置 行:4 字符: 15
    +         cout << res[u] << '\n';
    +               ~
    “<”运算符是为将来使用而保留的。
    所在位置 行:4 字符: 25
    +         cout << res[u] << '\n';
    +                         ~
    重定向运算符后面缺少文件规范。
    所在位置 行:4 字符: 24
    +         cout << res[u] << '\n';
    +                        ~
    “<”运算符是为将来使用而保留的。
    所在位置 行:4 字符: 25
    +         cout << res[u] << '\n';
    “<”运算符是为将来使用而保留的。
    所在位置 行:6 字符: 20
    +     if (t[u].empty()) return;
    +                    ~
    “(”后面应为表达式。
    所在位置 行:6 字符: 21
    +     if (t[u].empty()) return;
    +                     ~
    if(条件)后面缺少语句块。
    并未报告所有分析错误。请更正报告的错误并重试。
        + FullyQualifiedErrorId : MissingExpressionAfterOperator
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> 
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> int main() {
    >>     ios::sync_with_stdio(false);
    >>     int n, now = 0;
    >>     cin >> n >> V;
    >>     for (int i = 1; i <= n; i ++) {
    >>         string s;
    >>         int x, y;
    >>         cin >> s;
    >>         if (s == "add") {
    >>             cin >> x >> y;
    >>             t[now].push_back(++ tot);
    所在位置 行:1 字符: 10
    + int main() {
    +          ~
    “(”后面应为表达式。
    所在位置 行:4 字符: 14
    +     cin >> n >> V;
    +              ~~~~
    已重定向此命令的 输出流。
    所在位置 行:5 字符: 23
    +     for (int i = 1; i <= n; i ++) {
    +                       ~
    “<”运算符是为将来使用而保留的。
    所在位置 行:10 字符: 22
    +             cin >> x >> y;
    +                      ~~~~
    已重定向此命令的 输出流。
    所在位置 行:11 字符: 32
    +             t[now].push_back(++ tot);
    +                                ~
    一元运算符“++”后面缺少表达式。
    所在位置 行:11 字符: 33
    +             t[now].push_back(++ tot);
    +                                 ~~~
    表达式或语句中包含意外的标记“tot”。
    所在位置 行:11 字符: 32
    +             t[now].push_back(++ tot);
    +                                ~
    表达式中缺少右“)”。
    所在位置 行:9 字符: 25
    +         if (s == "add") {
    语句块或类型定义中缺少右“}”。
    所在位置 行:5 字符: 35
    +     for (int i = 1; i <= n; i ++) {
    +                                   ~
    语句块或类型定义中缺少右“}”。
    所在位置 行:1 字符: 12
    + int main() {
    语句块或类型定义中缺少右“}”。
    并未报告所有分析错误。请更正报告的错误并重试。
        + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : ExpectedExpression
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin>             fa[tot] = now;
    fa[tot] : 无法将“fa[tot]”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
    +             fa[tot] = now;
    +             ~~~~~~~
        + CategoryInfo          : ObjectNotFound: (fa[tot]:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin>             X[tot] = x;
    X[tot] : 无法将“X[tot]”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
    +             X[tot] = x;
    +             ~~~~~~
        + CategoryInfo          : ObjectNotFound: (X[tot]:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin>             Y[tot] = y;
    Y[tot] : 无法将“Y[tot]”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
    所在位置 行:1 字符: 13
    +             Y[tot] = y;
        + CategoryInfo          : ObjectNotFound: (Y[tot]:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin>             now = tot;
    now : 无法将“now”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
    所在位置 行:1 字符: 13
    +             now = tot;
        + CategoryInfo          : ObjectNotFound: (now:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin>         } else {
    >>             now = fa[now];
    >>         }
    所在位置 行:1 字符: 9
    +         ~
    表达式或语句中包含意外的标记“}”。
        + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : UnexpectedToken
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin>     }
    所在位置 行:1 字符: 5
    +     ~
    表达式或语句中包含意外的标记“}”。
        + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : UnexpectedToken
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin>     dfs(0);
    dfs : 无法将“dfs”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
    +     dfs(0);
    +     ~~~
        + CategoryInfo          : ObjectNotFound: (dfs:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin>     dfs2(0);
    dfs2 : 无法将“dfs2”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
    +     dfs2(0);
    +     ~~~~
        + CategoryInfo          : ObjectNotFound: (dfs2:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin>     tot = n;
    tot : 无法将“tot”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
    +     tot = n;
    +     ~~~
        + CategoryInfo          : ObjectNotFound: (tot:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin>     dfs3(0);
    dfs3 : 无法将“dfs3”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
    所在位置 行:1 字符: 5
    +     dfs3(0);
    +     ~~~~
        + CategoryInfo          : ObjectNotFound: (dfs3:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> }D:\\P5391.exe
    所在位置 行:1 字符: 1
    + }D:\\P5391.exe
    + ~
    表达式或语句中包含意外的标记“}”。
        + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : UnexpectedToken
     
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> void dfs2(int u) {        
    >>     if (u) {                    
    >>         dp[u] = dp[fa[u]];
    >>         for (int i = X[u]; i <= V; i ++) {
    >>             dp[u][i] = max(dp[u][i], dp[u][i - X[u]] + Y[u]);
    >>         }                    
    >>         if (u == son[fa[u]]) dp[fa[u]] = vector<int>();
    >>     } else dp[u].resize(V + 1);
    >>     res[u] = dp[u][V];                   
    >>     if (t[u].size()) {    
    >>         for (int v : t[u]) {         
    >>             if (v != son[u]) dfs2(v);
    >>         }
    >>         dfs2(son[u]);
    >>     } else {
    >>         dp[u] = vector<int>();
    >>     }
    >> }
    哎呀,出现问题。请在报告此 Bug 时添加以下详细信息。
    在 GitHub 上报告: https://github.com/lzybkr/PSReadLine/issues/new
    -----------------------------------------------------------------------
    上 200 个密钥:
     X [ t o t ] Space = Space x ; Enter
     Space Space Space Space Space Space Space Space Space Space Space Space Y [ t o t ] Space = Space y ; Enter
     Space Space Space Space Space Space Space Space Space Space Space Space n o w Space = Space t o t ; Enter
     Space Space Space Space Space Space Space Space } Space e l s e Space { Enter
     Space Space Space Space Space Space Space Space Space Space Space Space n o w Space = Space f a [ n o w ] ; Enter
     Space Space Space Space Space Space Space Space } Enter
     Space Space Space Space } Enter
     Space Space Space Space d f s ( 0 ) ; Enter
     Space Space Space Space d f s 2 ( 0 ) ; Enter
     Space Space Space Space t o t Space = Space n ; Enter
     Space Space Space Space d f s 3 ( 0 ) ; Enter
     } D : \ \ P 5 3 9 1 . e x e Enter
     UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow
    
    异常:
    System.ArgumentOutOfRangeException: 该值必须大于或等于零,且必须小于控制台缓冲区在该维度的大小。
    参数名: top
    实际值是 -3。
       在 System.Console.SetCursorPosition(Int32 left, Int32 top)
       在 Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
       在 Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
       在 Microsoft.PowerShell.PSConsoleReadLine.HistoryRecall(Int32 direction)
       在 Microsoft.PowerShell.PSConsoleReadLine.PreviousHistory(Nullable`1 key, Object arg)
       在 Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
       在 Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
       在 Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
    -----------------------------------------------------------------------
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin> void dfs2(int u) {                                                                                                                 
    >>     if (u) {                    
    >>         dp[u] = dp[fa[u]];
    >>         for (int i = X[u]; i <= V; i ++) {
    >>             dp[u][i] = max(dp[u][i], dp[u][i - X[u]] + Y[u]);
    >>         }                                             
    >>         if (u == son[fa[u]]) dp[fa[u]] = vector<int>();
    >>     } else dp[u].resize(V + 1);
    >>     res[u] = dp[u][V];                   
    >>     if (t[u].size()) {    
    >>         for (int v : t[u]) {         
    >>             if (v != son[u]) dfs2(v);
    >>         }
    >>         dfs2(son[u]);
    >>     } else {
    >>         dp[u] = vector<int>();
    >>     }
    >> }
    哎呀,出现问题。请在报告此 Bug 时添加以下详细信息。
    在 GitHub 上报告: https://github.com/lzybkr/PSReadLine/issues/new
    -----------------------------------------------------------------------
    上 200 个密钥:
     Space Space Space } Space e l s e Space { Enter
     Space Space Space Space Space Space Space Space Space Space Space Space n o w Space = Space f a [ n o w ] ; Enter
     Space Space Space Space Space Space Space Space } Enter
     Space Space Space Space } Enter
     Space Space Space Space d f s ( 0 ) ; Enter
     Space Space Space Space d f s 2 ( 0 ) ; Enter
     Space Space Space Space t o t Space = Space n ; Enter
     Space Space Space Space d f s 3 ( 0 ) ; Enter
     } D : \ \ P 5 3 9 1 . e x e Enter
     UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow DownArrow Ctrl+z UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow UpArrow
    
    异常:
    System.ArgumentOutOfRangeException: 该值必须大于或等于零,且必须小于控制台缓冲区在该维度的大小。
    参数名: top
    实际值是 -3。
       在 System.Console.SetCursorPosition(Int32 left, Int32 top)
       在 Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
       在 Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
       在 Microsoft.PowerShell.PSConsoleReadLine.HistoryRecall(Int32 direction)
       在 Microsoft.PowerShell.PSConsoleReadLine.PreviousHistory(Nullable`1 key, Object arg)
       在 Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
       在 Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
       在 Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
    -----------------------------------------------------------------------
    PS C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin>                                                                                                                                    
                     
                               
                      
    

    I saw this when I paste my code on powershell by accident.

  4. xiaoyiming123 commented on May 10, 2026

    @xiaoyiming123

    Then I pressed many up arrows and saw this.

  5. xiaoyiming123 commented on May 10, 2026

    @xiaoyiming123
  6. github-actions commented on May 10, 2026

    @github-actions

    2172635904, you were using a pretty old version of PSReadLine (2.0.0-beta2 or prior), and it's likely that the issue was fixed in a newer version.
    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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