tolstoyevsky / gits Goto Github PK
View Code? Open in Web Editor NEWWeb-based terminal emulator
License: Apache License 2.0
Web-based terminal emulator
License: Apache License 2.0
Now the Terminal
has two public methods: write
and dumphtml
.
Such API doesn't provide the clear interface to the Terminal
and it's not obvious what the write
method is actually does.
The PR #84 provides all methods of the Terminal
with the docstrings, but the write
doesn't have it, because of the future rework that will be done in this issue.
According to the specification[1], cub1
moves the cursor left by 1 position. However, the current implementation of the capability moves the cursor one line up. Moreover, it has a bug: cub1
moves the cursor one line up when the cursor is not at the left-most position.
[1] http://pubs.opengroup.org/onlinepubs/7908799/xcurses/terminfo.html
bold text support
blink text support
underscore text support
The dl
capability is more difficult than it may seem, so its docstring should be expanded.
ss.sF.ssssss....s.......ss..sss..ssss.sss....ss.......
======================================================================
FAIL: test_cap_cub1 (__main__.TestEmulator)
The terminal should have the possibility to move cursor left by 1
----------------------------------------------------------------------
Traceback (most recent call last):
File "gits/test/terminal_test.py", line 522, in test_cap_cub1
self._check_cap_cub1((rand_x, 0))
File "gits/test/terminal_test.py", line 503, in _check_cap_cub1
self.assertEqual(cur_x - 1, term._cur_x)
AssertionError: 0 != 79
----------------------------------------------------------------------
Ran 54 tests in 0.491s
FAILED (failures=1, skipped=24)
It would be good to have some info about the running server (e.g. port, host).
It's painful each time to write:
env PYTHONPATH=`pwd` ../gits-env/bin/python bin/server
env PYTHONPATH=`pwd` ../gits-env/bin/python gits/test/terminal_test.py
Can we have some helper shell script for this?
ConfigReader
Loads configuration files related to matching escape sequences to capabilities.
Screen
Contains data for renderer. Will contain rules about setting, updating the screen cell (color, attribute).
HTMLRenderer
Gets data from Screen
and ConfigReader
and builds HTML.
CommandExecutor
Matches the raw escape sequence to the capability and executes this capability.
Terminal
High level logic, a facade, under the HTMLRenderer
, CommandExecutor
, ConfigReader
, Screen
. As a result, only the terminal should be able to the wide world.
cup
is a combination of vpa
and hpa
.
Such programs like vi
may send something like \E[23;80H
(set the vertical and horizontal positions of the cursor to y
and x
). The current implementation of cup
will set _eol
to True in this case and _echo
will write a character on the next line. It's obviously a bug.
Now, we only run tests for gits for one platform. Need to test, built, run gits for following platforms:
There is an agreement that all methods names that represent capabilities should have the following format _cap_{capability_name}
, but there are some methods that don't match this format.
E.g., _cap_set_color
.
The existing implementation uses the hardcoded screen size (24x80).
Each time an interactive program runs, it tells the terminal to hide the cursor. When it exits, the cursor should be restored.
During a building gits for varios platforms I've realized that living with a python and nodejs at the same time is a big pain in the ass.
Let's begin with Linux Mint:
Fedora 24:
MacOS:
I specify only a little problems above, because I didn't notice all problems and forgot some of them.
Overall wishes:
Can we move our doc back to github from readthedoc? It's a personal experience, but it's more convenient to have all stuff about gits in a one place.
The terminal should have the possibility to interact with a computer mouse.
The methods
ability to change background color
ability to choose the font family
ability to change the font size
Try to delete the whole line with the cap_dch
capability, but got the error.
How to reproduce:
self._check_cap_dch(['f'] * term._right_most, term._right_most)
See also: #40.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.