Welcome to the Linux Foundation Forum!

Web browser instead of xterm

Sławomir Lach
Sławomir Lach Posts: 27
edited January 2017 in Software Development
I have got an idea to replace terminal emulators with modern web browser. It give possibility to use rich formatting(via html/css), forms(html), changeable ui(via EcmaScript), etc. I have one question - which escape sequence could I use to switch to/from html mode?

The web browser would set BROWSER_ID environment variable, so programs could detect it is running in browser, When program checks this env, it could send special escape sequence to switch to html mode and add - for example - table, some images(like progress bars) to output. It could also sends Ecma Scripts command on some file descriptor, so program can modify web page it produces.

Programs could use links to other programs, with parameters, of course. Imagine ls adds links to each directory and this link points to ls with path to given directory.

Web browser could give possibility to select output of command and click send as input to command, to run new command with given input.

Possibilities are many. Is someone interested/can help?

What about security? First problem is when root is run browser and command as specified, unprivileged user. In this case, program could read each file, using for example image tag. Solution would be simple - don't run pages as local page, but remote page, so each access to resources must be accepted by user of web browser.

Comments

  • romuffel
    romuffel Posts: 4

    This is a really interesting idea that opens up a lot of possibilities for interacting with the terminal. Using a modern web browser to emulate a terminal with HTML/CSS and EcmaScript support can really improve the user experience and functionality.

    As for security, this is definitely an important aspect, especially when it comes to running commands and interacting with files. To minimize risks, as you rightly noted, you can run pages as remote instead of local, and require confirmation of access to resources from the user.

    By the way, if you work with such tasks, I would recommend paying attention to anti-detection browsers, such as https://masqad.com/. They can help provide additional security and privacy when performing various operations on the Internet, which is especially important when working with terminals and other critical tools.

Categories

Upcoming Training