-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught TypeError: Cannot set property '0' of undefined #164
Comments
Hello @tqlihuiqi - thanks for reporting. Are you testing on the latest master branch? Also, in which browser you're testing? |
Hi, @akalipetis I use the latest master branch on Chrome/Firefox on OSX. I've already resolve this issue. code:
|
@tqlihuiqi Could you provide more info about what you did, the error (with stacktrace?) and what exactly fixed the problem? The
doesnt look like a real solution to me - you still execute Atm your description is somewhat cryptic and not reproducable with the spare info. |
I have written a with the function of audit SSH client,I want to send the output file via a browser display, So I use the WEBSOCKET receives the message, and then through the XTERM to display a message to the page. At that time when I was in terminal input VI command, raised exception. I try to write VI command returns a message on the console: console.log(event.data)
XTERM throw an exception
So I judge xterm.write(event.data) back to write page success, throw an exception when I would write a null character |
Looks like I guess your xterm geometry is not in sync with the pty, since vi is trying to set the y scroll margins to 0 and 29 ( |
@tqlihuiqi opening Could you please update to the latest version of the
This way we will be able to approach this problem better and find out why this happens. |
I have the same problem on our project. Opening And I could use |
I've been able to replicate this issue by setting a scroll region to a bottom value that is higher then the number of rows, then printing a lot of new lines to the screen. printf "\033[1;300r"
grep -Rl ' ' . I'll submit a PR with a fix. |
[issue #164] Fix bug that can occur when setting a scroll region
Closed in #514. |
I am on the latest version of xterm and am receiving this error again. Has something gone in recently which could have brought this bug back? It always seems to fail on row 24. While my terminal is configured with 7 rows. I inspected the |
@tht13 can you get the stack and try find the line it's failing on? I added some defensive checks to protect against at least one case of this. It might be a different regression (I haven't seen any reports though on 2.6). |
It is failing on InputHandler.ts:86 Stacktrace:
|
I've debugged a bit further and the problem seems to come from calling a resize while writing to the terminal. The async nature of the write seems to cause some issue. I'll add a wait on the resize event to my code, that should fix it. |
Unfortunately waiting on the resize event didn't help, I thought I solved the issue by delaying the resize through a timeout but it seems that any write to the terminal after the resize causes it to fail, even if it is minute later. Here is some code which should reproduce the issue (without the timeout): const term = new xterm();
term.open(document.getElementById("container"));
term.resize(cols, rows);
for (let i=0;i<30;i++) term.writeln(i.toString()); |
execute vi / vim command throw exception
error:
Uncaught TypeError: Cannot set property '0' of undefined
debug:
Serial port requested application keypad.
code:
<script src="/static/plugins/xterm/src/xterm.js"></script>
The text was updated successfully, but these errors were encountered: