Exception on Windows triggered by inline prediction with CJK characters

Open
#4,737 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp, powershell
Domain
cli

Research direction

Reproduce the Windows failure with CJK characters during inline prediction, then start at ConvertOffsetToPoint and follow its callers through ReallyRender, ForceRender, and Insert in the exception stack. Confirm the fix by rerunning the reported command and verifying that rendering no longer throws an IndexOutOfRangeException and preserves the command text.

Written by the indexing model from the issue text.

Description

Area-Stability Needs-Triage :mag:
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
WARNING: The version '2.3.6' of module 'PSReadLine' is currently in use. Retry the operation after closing the applications.
PS C:\Users\User\Dropbox\3_Obsidian> mkdir "1_Knowledge_Database/Artificial_Intelligence/機器學習 (Machine Learning)/04_後續學習方向/章節 11:深度學習簡 介" && echo "# 章節 11:深度學習簡介^r^n^r^n## 學習目標:^r^n對深度學習有一個初步的認識,了解其與傳統機器學習的區別以及常見的深度學習框架。^r^n^r^n## 具 體學習內容:^r^n*   **神經網路基礎:**^r^n    *   人工神經元 (Perceptron)。^r^n    *   多層感知器 (Multi-layer Perceptron, MLP)。^r^n    *   激活函數 (Activation Functions) (ReLU, Sigmoid, Tanh)。^r^n    *   前向傳播 (Forward Propagation)。^r^n    *   反向傳播 (Backpropagation) 與梯度下降 (Gradient Descent) (複習並應用於神經網路)。^r^n*   **深度學習與傳統機器學習的區別:**^r^n    *   特徵工程:深度學習可以自動學習特徵。^r^n    *   數據量需求:深度學習通常需要大量數據。^r^n    *   模型複雜度。^r^n*   **常見的深度學習框架 (簡介):**^r^n    *   **TensorFlow:** Google 開發的開源深度學習框架。^r^n    *   **PyTorch:** Facebook (Meta) 開發的開源深度學習框架。^r^n    *   了解它們的基本概念和用途。^r^n*   **常見的深度學習模型架構 (簡介):**^r^n    *   卷積神經網路 (Convolutional Neural Networks, CNN) (用於圖像處理)。^r^n    *   循環神經網路 (Recurrent Neural Networks, RNN) (用於序列數據,如文本)。^r^n^r^n## 實踐練習:^r^n*   (可選)使用 TensorFlow 或 PyTorch 搭建一個簡單的神經網路模型,並在一個小型數據集上進行訓練。^r^n*   閱讀關於 CNN 和 RNN 的入門文章。^r^n...
Oops, something went wrong.
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.yaml
Thank you!

### Environment
PSReadLine: 2.3.6+d2e770f93b7a53d8660a6402eb29d1ae1c35e767
PowerShell: 7.5.0
OS: Microsoft Windows 10.0.26100
BufferWidth: 153
BufferHeight: 9

Last 62 Keys:

 m U p d a t e - M o d u l e Spacebar P S R e a d L i n e Enter
 I n s t a l l - M o d u l e Spacebar P S R e a d L i n e Spacebar - F o r c e \ Backspace Enter
 m

### Exception

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Text.StringBuilder.get_Chars(Int32 index)
   at Microsoft.PowerShell.PSConsoleReadLine.ConvertOffsetToPoint(Int32 offset)
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   at Microsoft.PowerShell.PSConsoleReadLine.Render()
   at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
   at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(PSKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken, Nullable`1 lastRunStatus)


PS C:\Users\User\Dropbox\3_Obsidian> mkdir "1_Knowledge_Database/Artificial_Intelligence/機器學習 (Machine Learning)/04_後續學習方向/章節 11:深度學習簡 介" && echo "# 章節 11:深度學習簡介^r^n^r^n## 學習目標:^r^n對深度學習有一個初步的認識,了解其與傳統機器學習的區別以及常見的深度學習框架。^r^n^r^n## 具 體學習內容:^r^n*   **神經網路基礎:**^r^n    *   人工神經元 (Perceptron)。^r^n    *   多層感知器 (Multi-layer Perceptron, MLP)。^r^n    *   激活函數 (Activation Functions) (ReLU, Sigmoid, Tanh)。^r^n    *   前向傳播 (Forward Propagation)。^r^n    *   反向傳播 (Backpropagation) 與梯度下降 (Gradient Descent) (複習並應用於神經網路)。^r^n*   **深度學習與傳統機器學習的區別:**^r^n    *   特徵工程:深度學習可以自動學習特徵。^r^n    *   數據量需求:深度學習通常需要大量數據。^r^n    *   模型複雜度。^r^n*   **常見的深度學習框架 (簡介):**^r^n    *   **TensorFlow:** Google 開發的開源深度學習框架。^r^n    *   **PyTorch:** Facebook (Meta) 開發的開源深度學習框架。^r^n    *   了解它們的基本概念和用途。^r^n*   **常見的深度學習模型架構 (簡介):**^r^n    *   卷積神經網路 (Convolutional Neural Networks, CNN) (用於圖像處理)。^r^n    *   循環神經網路 (Recurrent Neural Networks, RNN) (用於序列數據,如文本)。^r^n^r^n## 實踐練習:^r^n*   (可選)使用 TensorFlow 或 PyTorch 搭建一個簡單的神經網路模型,並在一個小型數據集上進行訓練。^r^n*   閱讀關於 CNN 和 RNN 的入門文章。^r^n...
Screenshot

Image

Environment data
PSReadLine: 2.3.6+d2e770f93b7a53d8660a6402eb29d1ae1c35e767
PowerShell: 7.5.0
OS: Microsoft Windows 10.0.26100
BufferWidth: 153
BufferHeight: 9
Steps to reproduce

PS C:\Users\User\Dropbox\3_Obsidian> mkdir "1_Knowledge_Database/Artificial_Intelligence/機器學習 (Machine Learning)/04_後續學習方向/章節 11:深度學習簡 介" && echo "# 章節 11:深度學習簡介^r^n^r^n## 學習目標:^r^n對深度學習有一個初步的認識,了解其與傳統機器學習的區別以及常見的深度學習框架。^r^n^r^n## 具 體學習內容:^r^n* 神經網路基礎:^r^n * 人工神經元 (Perceptron)。^r^n * 多層感知器 (Multi-layer Perceptron, MLP)。^r^n * 激活函數 (Activation Functions) (ReLU, Sigmoid, Tanh)。^r^n * 前向傳播 (Forward Propagation)。^r^n * 反向傳播 (Backpropagation) 與梯度下降 (Gradient Descent) (複習並應用於神經網路)。^r^n* 深度學習與傳統機器學習的區別:^r^n * 特徵工程:深度學習可以自動學習特徵。^r^n * 數據量需求:深度學習通常需要大量數據。^r^n * 模型複雜度。^r^n* 常見的深度學習框架 (簡介):^r^n * TensorFlow: Google 開發的開源深度學習框架。^r^n * PyTorch: Facebook (Meta) 開發的開源深度學習框架。^r^n * 了解它們的基本概念和用途。^r^n* 常見的深度學習模型架構 (簡介):^r^n * 卷積神經網路 (Convolutional Neural Networks, CNN) (用於圖像處理)。^r^n * 循環神經網路 (Recurrent Neural Networks, RNN) (用於序列數據,如文本)。^r^n^r^n## 實踐練習:^r^n* (可選)使用 TensorFlow 或 PyTorch 搭建一個簡單的神經網路模型,並在一個小型數據集上進行訓練。^r^n* 閱讀關於 CNN 和 RNN 的入門文章。^r^n...

Expected behavior

PS C:\Users\User\Dropbox\3_Obsidian> mkdir "1_Knowledge_Database/Artificial_Intelligence/機器學習 (Machine Learning)/04_後續學習方向/章節 11:深度學習簡 介" && echo "# 章節 11:深度學習簡介^r^n^r^n## 學習目標:^r^n對深度學習有一個初步的認識,了解其與傳統機器學習的區別以及常見的深度學習框架。^r^n^r^n## 具 體學習內容:^r^n* 神經網路基礎:^r^n * 人工神經元 (Perceptron)。^r^n * 多層感知器 (Multi-layer Perceptron, MLP)。^r^n * 激活函數 (Activation Functions) (ReLU, Sigmoid, Tanh)。^r^n * 前向傳播 (Forward Propagation)。^r^n * 反向傳播 (Backpropagation) 與梯度下降 (Gradient Descent) (複習並應用於神經網路)。^r^n* 深度學習與傳統機器學習的區別:^r^n * 特徵工程:深度學習可以自動學習特徵。^r^n * 數據量需求:深度學習通常需要大量數據。^r^n * 模型複雜度。^r^n* 常見的深度學習框架 (簡介):^r^n * TensorFlow: Google 開發的開源深度學習框架。^r^n * PyTorch: Facebook (Meta) 開發的開源深度學習框架。^r^n * 了解它們的基本概念和用途。^r^n* 常見的深度學習模型架構 (簡介):^r^n * 卷積神經網路 (Convolutional Neural Networks, CNN) (用於圖像處理)。^r^n * 循環神經網路 (Recurrent Neural Networks, RNN) (用於序列數據,如文本)。^r^n^r^n## 實踐練習:^r^n* (可選)使用 TensorFlow 或 PyTorch 搭建一個簡單的神經網路模型,並在一個小型數據集上進行訓練。^r^n* 閱讀關於 CNN 和 RNN 的入門文章。^r^n...

Actual behavior

kdir "1_Knowledge_Database/Artificial_Intelligence/機器學習 (Machine Learning)/04_後續學習方向/章節 11:深度學習簡 介" && echo "# 章節 11:深度學習簡介^r^n^r^n## 學習目標:^r^n對深度學習有一個初步的認識,了解其與傳統機器學習的區別以及常見的深度學習框架。^r^n^r^n## 具 體學習內容:^r^n* 神經網路基礎:^r^n * 人工神經元 (Perceptron)。^r^n * 多層感知器 (Multi-layer Perceptron, MLP)。^r^n * 激活函數 (Activation Functions) (ReLU, Sigmoid, Tanh)。^r^n * 前向傳播 (Forward Propagation)。^r^n * 反向傳播 (Backpropagation) 與梯度下降 (Gradient Descent) (複習並應用於神經網路)。^r^n* 深度學習與傳統機器學習的區別:^r^n * 特徵工程:深度學習可以自動學習特徵。^r^n * 數據量需求:深度學習通常需要大量數據。^r^n * 模型複雜度。^r^n* 常見的深度學習框架 (簡介):^r^n * TensorFlow: Google 開發的開源深度學習框架。^r^n * PyTorch: Facebook (Meta) 開發的開源深度學習框架。^r^n * 了解它們的基本概念和用途。^r^n* 常見的深度學習模型架構 (簡介):^r^n * 卷積神經網路 (Convolutional Neural Networks, CNN) (用於圖像處理)。^r^n * 循環神經網路 (Recurrent Neural Networks, RNN) (用於序列數據,如文本)。^r^n^r^n## 實踐練習:^r^n* (可選)使用 TensorFlow 或 PyTorch 搭建一個簡單的神經網路模型,並在一個小型數據集上進行訓練。^r^n* 閱讀關於 CNN 和 RNN 的入門文章。^r^n...

Dominant language
C#
Stars
4.4k
Forks
341
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PowerShell/PSReadLine

All issues in PowerShell/PSReadLine

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.