aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen.rs
diff options
context:
space:
mode:
authorDanny Weinberg <FuegoFro@gmail.com>2023-04-17 13:08:26 -0700
committerDanny Weinberg <FuegoFro@gmail.com>2023-04-17 13:08:26 -0700
commit988ce9dce47d485e02dbde35573de3d14065b27e (patch)
tree63b479cd3faebc11d6ab92db961145b57af77229 /src/screen.rs
parent7021de793f9945789276db2dd1006aac64f24495 (diff)
downloadvt100-rust-988ce9dce47d485e02dbde35573de3d14065b27e.tar.gz
vt100-rust-988ce9dce47d485e02dbde35573de3d14065b27e.zip
Add support for CSI E/F (next and previous line)
This adds support for the following two operations: - https://vt100.net/docs/vt510-rm/CNL.html - https://vt100.net/docs/vt510-rm/CPL.html While it looks like these weren't technically implemented in the vt100, it does seem that a number of modern terminals (iTerm2, Windows Terminal, as two examples) support them.
Diffstat (limited to 'src/screen.rs')
-rw-r--r--src/screen.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/screen.rs b/src/screen.rs
index ad54694..6eeb2e3 100644
--- a/src/screen.rs
+++ b/src/screen.rs
@@ -1083,6 +1083,18 @@ impl Screen {
self.grid_mut().col_dec(offset);
}
+ // CSI E
+ pub(crate) fn cnl(&mut self, offset: u16) {
+ self.grid_mut().col_set(0);
+ self.grid_mut().row_inc_clamp(offset);
+ }
+
+ // CSI F
+ pub(crate) fn cpl(&mut self, offset: u16) {
+ self.grid_mut().col_set(0);
+ self.grid_mut().row_dec_clamp(offset);
+ }
+
// CSI G
pub(crate) fn cha(&mut self, col: u16) {
self.grid_mut().col_set(col - 1);