Howdy,
A while ago, I mentioned to you that I often hit a "SlyEdit: Input timeout reached." (and logging in as Sysop I didnt expect to be hit with any timeouts).
Lately, I've hit it a few times, which is particuarly annoying when I'm half way thorough a large messages.
I've noticed its very much random in its timing. Sometimes it would happen within seconds of composing a messages, othertimes I could leave Slyedit running for hours and it would happen. So I thought it might be a key sequence that I'm hitting.
Sure enough, I've noticed that whenever I hit CTRL-Space (I'm on a MAC - and sometimes I hit that by mistake), Slyedit aborts with "Input timeout reached".
I dont always use Syncterm - often iTerm (a MAC telnet client), and I dont think it happens in Syncterm.
So just wondering if there is a keyboard input sequence that you are not trapping that results in going to "Input timeout reached" and aborts the editor. I can pretty much do it everytime now.
...ëîåï
... if that happens in iTerm and not Syncterm (did you test other terminal clients?) perhaps it is a key binding in iTerm
that SlyEdit might be expecting as an upload attachment type thingy?
Sure enough, I've noticed that whenever I hit CTRL-Space (I'm on a MAC - and sometimes I hit that by mistake), Slyedit aborts with "Input timeout reached".
I dont always use Syncterm - often iTerm (a MAC telnet client), and I dont think it happens in Syncterm.
So just wondering if there is a keyboard input sequence that you are not trapping that results in going to "Input timeout reached" and aborts the editor. I can pretty much do it everytime now.
Re: Re: Slyedit
By: Mortifis to deon on Thu Jan 21 2021 12:35 am
... if that happens in iTerm and not Syncterm (did you test other terminal clients?) perhaps it is a key binding in iTerm
that SlyEdit might be expecting as an upload attachment type thingy?
Hmm.. it could well be - although I thought message upload was anything CTRL char (maybe it is CTRL-space? and hence why it aborts since iterm cannot upload).
It'd helpful to know the actual character value being sent when you hit Ctrl-Space. If you go into the user terminal settings, where it prompt you to hit backspace/delete, if you hit Ctrl-Space, what character value does it report?
Re: Re: Slyedit
By: Digital Man to deon on Thu Jan 21 2021 12:06 pm
It'd helpful to know the actual character value being sent when you hit Ctrl-Space. If you go into the user terminal settings, where it prompt you to hit backspace/delete, if you hit Ctrl-Space, what character value does it report?
So it appears to be sending NUL 0x00.
In the terminal settings pressing Ctrl-Space for the "delete" character, yielded nothing.
I got hold of a key scanning tool for the MAC, and it reports this for CTRL Space:
Key Down
Characters:
Unicode:0 / 0x0
Keys:^Space
Key Code: 49 / 0x31
Modifiers: 262401 / 0x40101
And for comparison, the delete key shows this.
Key Down
Characters:
Unicode:127 / 0x7f
Keys:(backspace symbol)
Key Code: 51 / 0x33
Modifiers: 256 / 0x100
So maybe ignoring a NUL character would be sufficient?
Currently, in JS, a console.inkey() timeout looks the same as the receipt of a NUL (ASCII 0) from the user.
I just committed a change so that a script can use a new mode flag (K_NUL) to differentiate between the 2 conditions and SlyEdit could make use of that. Or he could just ignore the empty string result of console.inkey().
Re: Re: Slyedit
By: Digital Man to deon on Thu Jan 21 2021 06:05 pm
Currently, in JS, a console.inkey() timeout looks the same as the receipt of a NUL (ASCII 0) from the user.
I just committed a change so that a script can use a new mode flag (K_NUL) to differentiate between the 2 conditions and SlyEdit could make use of that. Or he could just ignore the empty string result of console.inkey().
Ahh, OK, great, thanks.
I'll wait for Nightfox to make some changes (or Nightfox if you can tell me which lines to play with, I can have a go and see if this change helps - will save me having to find and learn your code :)
These appear to be the relevant lines, in SlyEdit.js:
Re: Re: Slyedit
By: Digital Man to deon on Thu Jan 21 2021 09:39 pm
These appear to be the relevant lines, in SlyEdit.js:
So I had a play and didnt get anywhere. (SlyEdit uses getkey(), not inkey()).
Re: Re: Slyedit
By: Digital Man to deon on Thu Jan 21 2021 09:39 pm
These appear to be the relevant lines, in SlyEdit.js:
So I had a play and didnt get anywhere. (SlyEdit uses getkey(), not inkey()).
require("sbbsdefs.js", "K_NOCRLF");
foo = console.getkey(K_NUL);
writeln('GETKEY (K_NULL): ['+JSON.stringify(foo)+'] ('+foo.charCodeAt(0)+')'); bar = console.getkey(K_NONE);
writeln('GETKEY (K_NONE): ['+JSON.stringify(bar)+'] ('+bar.charCodeAt(0)+')');
foo = console.inkey(K_NUL,10000);
writeln('INKEY (K_NULL): ['+JSON.stringify(foo)+'] ('+foo.charCodeAt(0)+')'); bar = console.inkey(K_NONE,10000);
writeln('INKEY (K_NONE): ['+JSON.stringify(bar)+'] ('+bar.charCodeAt(0)+')'); console.pause();
So I put together this script and ran it with ;exec ?testkey
And got this result:
GETKEY (K_NULL): ["\u000d"] (13)
GETKEY (K_NONE): ["\u000d"] (13)
INKEY (K_NULL): [""] (NaN)
INKEY (K_NONE): [""] (NaN)
The first 2 times I pressed CTRL-Space and nothing happened, so I pressed enter (hence the 0x0d).
The next two times, I only pressed CTRL-Space and they both yieled the same result.
Have I missed something?
Re: Re: Slyedit
By: deon to Digital Man on Fri Jan 22 2021 10:34 pm
Re: Re: Slyedit
By: Digital Man to deon on Thu Jan 21 2021 09:39 pm
These appear to be the relevant lines, in SlyEdit.js:
So I had a play and didnt get anywhere. (SlyEdit uses getkey(), not inkey()).
require("sbbsdefs.js", "K_NOCRLF");
foo = console.getkey(K_NUL);
writeln('GETKEY (K_NULL): ['+JSON.stringify(foo)+'] ('+foo.charCodeAt(0)+')'); bar = console.getkey(K_NONE);
writeln('GETKEY (K_NONE): ['+JSON.stringify(bar)+'] ('+bar.charCodeAt(0)+')');
foo = console.inkey(K_NUL,10000);
writeln('INKEY (K_NULL): ['+JSON.stringify(foo)+'] ('+foo.charCodeAt(0)+')'); bar = console.inkey(K_NONE,10000); writeln('INKEY (K_NONE): ['+JSON.stringify(bar)+'] ('+bar.charCodeAt(0)+')'); console.pause();
So I put together this script and ran it with ;exec ?testkey
And got this result:
GETKEY (K_NULL): ["\u000d"] (13)
GETKEY (K_NONE): ["\u000d"] (13)
INKEY (K_NULL): [""] (NaN)
INKEY (K_NONE): [""] (NaN)
The first 2 times I pressed CTRL-Space and nothing happened, so I pressed enter (hence the 0x0d).
The next two times, I only pressed CTRL-Space and they both yieled the same result.
Have I missed something?
The K_NUL optoin won't do anything different with older builds of sbbs. Did you get and build the latest sbbs code from git?
The K_NUL optoin won't do anything different with older builds of sbbs. Did you get and build the latest sbbs code from git?
SlyEdit uses inkey() in SlyEdit_Misc.js -> getUserKey():
I don't have a terminal handy with an obvious method of sending an ASCII NUL (0), but I certainly got different results upon timeout (as expected) when using the new K_NUL mode flag and the new sbbs.
I don't have a terminal handy with an obvious method of sending an ASCII NUL (0), but I certainly got different results upon timeout (as expected) when using the new K_NUL mode flag and the new sbbs.
Re: Re: Slyedit
By: Digital Man to deon on Fri Jan 22 2021 12:02 pm
Howdy,
I don't have a terminal handy with an obvious method of sending an ASCII NUL (0), but I certainly got different results upon timeout (as expected) when using the new K_NUL mode flag and the new sbbs.
So yes, the line you quoted userInput == "" can be changed to userInput == null, and I no longer suffer the ctrl-space abort issue.
I also tested a timeout, and it trapped correctly.
Sysop: | Rempala |
---|---|
Location: | Richlands, NC |
Users: | 103 |
Nodes: | 10 (0 / 10) |
Uptime: | 173:51:34 |
Calls: | 158 |
Files: | 6 |
Messages: | 110,869 |