Unknown6656 / AutoIt-Interpreter

A C# AutoIt interpreter designed to be platform-independent
GNU Affero General Public License v3.0
37 stars 10 forks source link

[BUG] crash on pasting line into input field #203

Open MamiyaOtaru opened 4 months ago

MamiyaOtaru commented 4 months ago

Bug Description

crash on right click to paste a line into the input field for interactive interpretation

The value must be greater than or equal to zero and less than the console's buffer size in that dimension. (Parameter 'left') Actual value was -21.

at System.Console.SetCursorPosition(Int32 left, Int32 top) in /_/src/libraries/System.Console/src/System/Console.cs:line 578 at Unknown6656.AutoIt3.CLI.InteractiveShell.RedrawInputArea(Boolean blink) in C:\Users\myusername\Documents\GitHub\AutoIt-Interpreter\src\AutoItInterpreter\CommandLineInterface\InteractiveShell.cs:line 703 at Unknown6656.AutoIt3.CLI.InteractiveShell.MainLoop() in C:\Users\myusername\Documents\GitHub\AutoIt-Interpreter\src\AutoItInterpreter\CommandLineInterface\InteractiveShell.cs:line 259 at Unknown6656.AutoIt3.CLI.InteractiveShell.Run() in C:\Users\myusername\Documents\GitHub\AutoIt-Interpreter\src\AutoItInterpreter\CommandLineInterface\InteractiveShell.cs:line 208 at Unknown6656.AutoIt3.CLI.MainProgram.Run() in C:\Users\myusername\Documents\GitHub\AutoIt-Interpreter\src\AutoItInterpreter\CommandLineInterface\MainProgram.cs:line 332 at Unknown6656.AutoIt3.CLI.MainProgram.<>cDisplayClass42_0.b0() in C:\Users\myusername\Documents\GitHub\AutoIt-Interpreter\src\AutoItInterpreter\CommandLineInterface\MainProgram.cs:line 139 at Unknown6656.AutoIt3.Telemetry.<>cDisplayClass19_0.b0() in C:\Users\myusername\Documents\GitHub\AutoIt-Interpreter\src\AutoItInterpreter\Telemetry.cs:line 125 at Unknown6656.AutoIt3.Telemetry.Measure[T](TelemetryCategory category, Func`1 function) in C:\Users\myusername\Documents\GitHub\AutoIt-Interpreter\src\AutoItInterpreter\Telemetry.cs:line 142 at Unknown6656.AutoIt3.Telemetry.Measure(TelemetryCategory category, Action function) in C:\Users\myusername\Documents\GitHub\AutoIt-Interpreter\src\AutoItInterpreter\Telemetry.cs:line 123 at Unknown6656.AutoIt3.CLI.MainProgram.Start(String[] argv) in C:\Users\myusername\Documents\GitHub\AutoIt-Interpreter\src\AutoItInterpreter\CommandLineInterface\MainProgram.cs:line 93 at Program.

$(String[] args) in C:\Users\myusername\Documents\GitHub\AutoIt-Interpreter\src\AutoItInterpreter\EntryPoint.cs:line 14

Steps to reproduce the Bug

copy Local $sModulePath = "\local.lan\madeuppath$\internal\functions_lib\modules\get-configthings\get-configthings.psd1" right click to paste into input

Expected Behavior

Should be able to paste the line in without crashing. Whether it will do anything remains to be seen, though on some really old version (that lacked the Run command) pasting in and saving the variable for later reference worked fine, though a later line in the script to run was of course unsuccessful

Operating System Type

Windows

Operating System Architecture

x64

Operating System Descriptor

Microsoft Windows [Version 10.0.22631.3672]

AutoIt Interpreter Version

+-----------------+
|   .o++..        |   AUTOIT3 INTERPRETER
|   ... = .       |     Written by Unknown6656, 2018 - 2024
|o . o = + o      |
| O + . + = =     |   https://github.com/Unknown6656/AutoIt-Interpreter/
|  X .   S E .    |
|   = + . + +     |   Version 0.12.2471.8700, <unknown>
|  . = o + =      |   7AEA598A1632430F6C30F1E53EE757E9CEE29F2510782104355A4ECDBD6C4ED2
|   . . +.* o     |
|    . .o+.+.     |   Use this image to compare whether two AutoIt versions are equal.

Additional Information

No response

Unknown6656 commented 3 months ago

Thanks @MamiyaOtaru for reporting this bug. I am aware of its existence, having countered it myself recently when using a certain combination of linebreak characters (LF or CR) in the interactive mode.

I'm traveling a lot due to work and don't yet know when I'll be free to address this bug, but I'll try to fix it as soon as possible.


Possibly related issue: #198