I want to implement ssh terminal client in web browser. I need to implement server for ssh connections in ruby. There is a net/ssh library, but i dont know how to handle fullscreen programs like vim or midnight commander.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Let me attempt to reparse your questions: You’re trying to emulate a SSH console session on the web browser. You appear to have implemented simple console input/output for most commands, but appear to be getting garbage appearing when you try out fullscreen commands like ‘vim’ or midnight commander.
The problem you’re seeing is to related to how UN*X machines handle fullscreen console output on terminals. Fullscreen console applications consults the terminfo/termcap library to determine the escape-sequences required to clear the screen, delete a line, insert a line, put a cursor at a particular point, etc. What you’re seeing is the raw output of these escape sequences appearing for the default terminal-type, which is most probably ANSI based.
To solve your problem, you have to:
Depending on the tech-stack you’re using to implement your browser-app, you may be able to find libraries that other people may have developed to solve this problem.