PowerShell / PSReadLine

A bash inspired readline implementation for PowerShell
BSD 2-Clause "Simplified" License
3.77k stars 298 forks source link

ArgumentOutOfRangeException #4146

Closed YogeshGithub2023 closed 3 months ago

YogeshGithub2023 commented 3 months ago

Prerequisites

Exception report

//This is the code 
//2D Arrays

import java.util.*;

public class Arrays_2D_4th_DSA_12th_Lecture_June_10_2024 {

    public static void main(String args[]) {
        int matrix[][] = new int[3][3];
        int n= matrix.length, m= matrix[0].length;
        //int n = 3, m = 3; //We can also use code with this way 

        Scanner sc = new Scanner(System.in);
        for(int i=0; i<n; i++) {
            for(int j=0; j<m; j++) {
                matrix[i][j] = sc.nextInt();
            }
        }

        //Outer
        for(int i=0; i<n; i++) {
            for(int j=0; j<m; j++) {
                System.out.print(matrix[i][j] + " ");
            }
            System.out.println();
        }
    }
}
//......................................................................................................

Oops, something went wrong.  Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 9 Keys:
 Ctrl+v Enter
 c l e a r Enter
 Ctrl+v

Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: top
Actual value was -1.
   at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   at Microsoft.PowerShell.PSConsoleReadLine.Paste(Nullable`1 key, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)

Screenshot

image bug vs code

Environment data

NA

Steps to reproduce

Don't know

Expected behavior

Don't know

Actual behavior

Don't know

github-actions[bot] commented 3 months ago

@YogeshGithub2023, 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.