rickparrish / fTelnet

fTelnet: An HTML5 WebSocket client
GNU Affero General Public License v3.0
70 stars 38 forks source link

Given larger than max values GotoXY should goto max width / height. #24

Closed apamment closed 4 months ago

apamment commented 9 months ago

I think think this, given a large value say ESC[255;255H which is larger than say 80x25, it should go to the bottom right of the screen, rather than ignore the command.

I'm pretty sure I'm not the only one who uses this method to detect screen size? at present when reporting the position after setting the high value it returns the previous position and so thinks the screen height / width is very small.

https://github.com/rickparrish/fTelnet/blob/7a0853f6855d9c4c509b4f7b41b65e97cef49c9d/source/crt/Crt.ts#L581

rickparrish commented 9 months ago

I try to follow the behaviour of other popular clients, primarily SyncTerm, so I'm curious what the behaviour is with it?

apamment commented 9 months ago

I'm not certain. I think it does go to max x / max y as screen size detection works. (I tested in raw mode to be sure it wasn't picking up the screen size from telnet IAC).

rickparrish commented 4 months ago

Took awhile before I got back to this, but yeah it looks like SyncTerm works as you've described, so I've just updated fTelnet to match.