cs01 / Pyxtermjs
Licence: mit
A fully functional terminal in your browser.
Stars: ✭ 127
Programming Languages
python
139335 projects - #7 most used programming language
Projects that are alternatives of or similar to Pyxtermjs
Cancer Donation Portal Python Flask App
Flask App for Cancer Donation Portal using basic Python, SQLite3, HTML, CSS and Javascript
Stars: ✭ 32 (-74.8%)
Mutual labels: flask-application, flask
Python Dependency Injector
Dependency injection framework for Python
Stars: ✭ 1,203 (+847.24%)
Mutual labels: flask-application, flask
Alacritty Debian
Debian packages for alacritty.
Stars: ✭ 34 (-73.23%)
Mutual labels: terminal, terminal-emulators
Intro To Apis Flask
Starter repository for the Introductions to API course
Stars: ✭ 26 (-79.53%)
Mutual labels: flask-application, flask
Teds Terminal
A modern terminal emulator with high DPI support, mouse wheel scaling, 32-bit colour and tty compatible.
Stars: ✭ 20 (-84.25%)
Mutual labels: terminal, terminal-emulators
Flask Graphql
Adds GraphQL support to your Flask application.
Stars: ✭ 1,188 (+835.43%)
Mutual labels: flask-application, flask
Terminator Themes
🤘 The biggest collection of Terminator themes.
Stars: ✭ 717 (+464.57%)
Mutual labels: terminal, terminal-emulators
Flask Rest Template
template for a rest app with flask, flask-rest and more...
Stars: ✭ 95 (-25.2%)
Mutual labels: flask-application, flask
Awesome Terminals
Terminal Emulators
Stars: ✭ 80 (-37.01%)
Mutual labels: terminal, terminal-emulators
Jiosaavnapi
An unofficial API for JioSaavn written in Python 3
Stars: ✭ 123 (-3.15%)
Mutual labels: flask-application, flask
Hyper
A terminal built on web technologies
Stars: ✭ 37,504 (+29430.71%)
Mutual labels: terminal, terminal-emulators
Fluddy
🤝 A dependency-free command line utility for managing, updating, creating and launching Flask Apps.
Stars: ✭ 23 (-81.89%)
Mutual labels: terminal, flask
Alacritty
Alacritty is a modern terminal emulator that comes with sensible defaults, but
allows for extensive configuration. By integrating with other
applications, rather than reimplementing their functionality, it manages to
provide a flexible set of features with high performance.
The supported platforms currently consist of BSD, Linux, macOS and Windows.
Stars: ✭ 36,273 (+28461.42%)
Mutual labels: terminal, terminal-emulators
Wezterm
A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
Stars: ✭ 770 (+506.3%)
Mutual labels: terminal, terminal-emulators
Webterminal
ssh rdp vnc telnet sftp bastion/jump web putty xshell terminal jumpserver audit realtime monitor rz/sz 堡垒机 云桌面 linux devops sftp websocket file management rz/sz otp 自动化运维 审计 录像 文件管理 sftp上传 实时监控 录像回放 网页版rz/sz上传下载/动态口令 django
Stars: ✭ 1,124 (+785.04%)
Mutual labels: terminal, terminal-emulators
Terminator
multiple GNOME terminals in one window
Stars: ✭ 649 (+411.02%)
Mutual labels: terminal, terminal-emulators
Mtm
Perhaps the smallest useful terminal multiplexer in the world.
Stars: ✭ 677 (+433.07%)
Mutual labels: terminal, terminal-emulators
Snowflake
Graphical SFTP client and terminal emulator with helpful utilities
Stars: ✭ 1,676 (+1219.69%)
Mutual labels: terminal, terminal-emulators
pyxterm.js
A fully functional terminal in your browser.
How does this work?
On the backend:
- A Flask server is running
- The Flask server uses flask-socketio, a websocket library for Flask and socketio
- A pty ("pseudo-terminal") is spawned that runs bash.
- You can think of a pty as a way to serialize/deserialize a terminal session. The Python docs describe it as "starting another process and being able to write to and read from its controlling terminal programmatically".
On the frontend:
-
Xterm.js is used to render Xterm output data in the browser.
- This means escape codes used by terminals to control the cursor location, color, and other options can be passed directly to Xterm.js and Xterm.js will faithfully render them as a terminal would.
- Output from the pty process on the backend is fed into it.
- Input from the browser is passed via websocket to the pty's input
Why?
The real purpose of this is to show a basic proof of concept on how to bring Xterm.js, Python, Flask, and Websockets together to run a pty in the browser.
This is a
- starting point to build your own web app with a terminal
- learning tool to understand what a
pty
is, and how to use one in Python - way to see Flask and Flask-SocketIO in action
- way to play around with Xterm.js in a meaningful environment
Installation
There are a few ways to install and run.
Clone & Run Locally
Clone this repository, enter the pyxtermjs
directory, then run:
> python -m venv venv # must be python3.6+
> venv/bin/pip install -r requirements.txt
> venv/bin/python -m pyxtermjs
serving on http://127.0.0.1:5000
Install or Run latest version on PyPI
You can use pipx to try it out.
> pipx run pyxtermjs
serving on http://127.0.0.1:5000
You can also and have pyxtermjs
installed in an isolated environment, yet available on your $PATH with
> pipx install pyxtermjs
Run from GitHub source
Use pipx for this as well.
> pipx run --spec git+https://github.com/cs01/pyxtermjs.git pyxtermjs
serving on http://127.0.0.1:5000
API
> pyxtermjs --help
usage: pyxtermjs [-h] [-p PORT] [--host HOST] [--debug] [--version]
[--command COMMAND] [--cmd-args CMD_ARGS]
A fully functional terminal in your browser.
https://github.com/cs01/pyxterm.js
optional arguments:
-h, --help show this help message and exit
-p PORT, --port PORT port to run server on (default: 5000)
--host HOST host to run server on (use 0.0.0.0 to allow access
from other hosts) (default: 127.0.0.1)
--debug debug the server (default: False)
--version print version and exit (default: False)
--command COMMAND Command to run in the terminal (default: bash)
--cmd-args CMD_ARGS arguments to pass to command (i.e. --cmd-args='arg1
arg2 --flag') (default: )
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].