Comments (9)
Introduce new concept for terminal text layout
During resize, text lines that have the wrap attribute enabled are wrapped over the underlying ones.
rods
It is curious whether this approach is compatible with terminal reality.
from vtm.
from vtm.
As you change the size of the screen would vim be the first to wrap, hence leaving nothing to wrap by the terminal?
Almost all full-screen terminal applications do their own wrapping by inserting \n
or \e[y;xH
at the end. These applications keep track of the terminal size changes and redraw the entire screen when resizing.
When emitting long lines, terminal applications can rely on the terminal, but there is no single approach to wrap lines in terminals:
- Terminals can calculate the length of a string in cells using a different algorithm than the application, and as a result, they do wrapping in a different place where the application suggests
- There is no standard approach to dissecting ligatures and wide characters (Emoji, CJK) at the edge of the screen, although most wraps these characters entirely on a new line, the application cannot know about it in advance
from vtm.
For example vim
adds >
+ \e[2;1H
if a wide character is encountered at the end
from vtm.
VTM built-in terminal reserves additional screen lines under the long lines when outputting a file with long lines directly
lines can overlap on downsize If the screen size was wide when outputting (maybe I need to insert some markers to highlight when it happens, this only happens on downsizing )
from vtm.
The most important advantage of such a text layout in the terminal is the correct support for characters larger than one cell in height
Ultimately, this is required to support the following functionality
from vtm.
It is important to note that the process of overlaying lines is reversible, i.e. when overlaid, the lines themselves are not mangled, they are only drawn overlaid.
from vtm.
You can control whether the line is wrapped or not using private VT-commands
CSI 12 : 0 p
(default) to enable wrapping (\e[12:0p
)CSI 12 : 1 p
to enable wrapping (\e[12:1p
)CSI 12 : 2 p
(default) to disable wrapping (\e[12:2p
)
from vtm.
Apparently, the rods
concept is quite compatible with the terminal reality.
This can be tested with v0.2.9 release.
from vtm.
Related Issues (20)
- Reload config while running HOT 1
- Command history suddenly resets when pressing Alt (cmd.exe)
- Tiling window manager - select what to add HOT 5
- Project logo / icon HOT 10
- Per virtual terminal text search. HOT 5
- [feature request] launch application windows in vtm desktop through command line HOT 17
- Text wrap switch doesn't work
- Command arguments are not parsed correctly on POSIX systems
- Line splitting is broken and corrupts script expression
- Different exit code styles between UNIX and NT HOT 1
- Unnecessary translation layer if the applet type is not specified
- Dead modifier keys print incorrect characters in cmd.exe readline mode
- Graphical front-end (GUI-TUI Bridge) HOT 27
- Broken `vtm -?` output in non-UTF-8 code page
- Maintaining the "don't wrap configuration" HOT 4
- Standalone terminal focus is lost by left clicking on window menu
- PowerShell/PSReadLine don't use UTF-8 to echo input on Windows
- [Feature request] Always-on-top for app windows HOT 1
- [feature request] configurable window border HOT 8
- One-shot toggle to copy text while mouse tracking is active
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vtm.