Backspace in WebTerminal
I try to run a small test routine (guessing a random number) in WebTerminal but the result looks broken.
in IRISterminal:
in WebTerminal:
I think it relates to backspace.
Is there some special setting required?
The code:
a
s q=".......... guess [0..9]: "
f i=1:1 d b if p w ! w $c(9),"thank you",! q
q
b
w !,i,$c(9),q
f r v#1 q:(v?.1n) w " !no number",$c(8,8,8,8,8,8,8,8,8,8,8,8)
w " "
s r=$R(10),p=$s(v="":1,v=r:"!",v>r:"<",1:">")
s x=q,$e(x,r+1)="*",$e(x,v+1)=$s(v=r:"!",v>r:"<",1:">")
q:p w $c(13),$c(9),x s p=v=r q
Ping @Nikita Savchenko
Thanks Peter and Dmitry.
It looks like WebTerminal is just missing a backspace interpretation, client-side.
I can fix this problem once I have some free time, should be quick.
Thanks for reporting!
The problem is in the backspace ($ c (8, ......)) because that character is not recognized in an HTML simulation.
Please, try to change this line:
f r v#1 q:(v?.1n) w " !no number", $c(27,91)_12_"D"
This is the ESC [12D statement which is the same than $c(8) but the WebTerminal is able to interpret itI hope it helps you
Best regards,
Kurro López
probably a misinterpretation from my side:
I expected a terminal emulation, not a HTML simulation
The fact is that is is an ages-old artifact that was a demo written to run on a printing console that had just 7 bit ASCII
Surprising. WebTermal is my first "Terminal Emulation" that doesn't understand full ASCII
I'll remove it from my personal list.
In this environment, bear in mind that you can use ESC instruction using the same way that I've told you. You can use in both.
Have a look this link about ansi ESC sequences
http://ascii-table.com/ansi-escape-sequences.php
Good luck
Regards,
Kurro López