This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch tymux-10-quiet-head
in repository terminology.
View the commit online.
commit 83f2b28649bd1c7a3591255145f1aaae43f5e72d
Author: Boris Faure <[email protected]>
AuthorDate: Mon Nov 2 21:59:01 2026 +0000
termptyesc: honour the left margin on NEL and CR
NEL and CR went to column 0, ignoring DECLRMM's left margin
---
src/bin/termptyesc.c | 13 +++++++++----
tests/nel-margins.sh | 14 ++++++++++++++
tests/tests.results | 1 +
3 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 75e33c25..64a3168a 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -276,7 +276,12 @@ _tab_forward(Termpty *ty, int n)
static void
_cursor_to_start_of_line(Termpty *ty)
{
- ty->cursor_state.cx = ty->termstate.left_margin;
+ // a cursor left of the left margin goes to column 0
+ if ((ty->termstate.restrict_cursor) ||
+ (ty->cursor_state.cx >= ty->termstate.left_margin))
+ ty->cursor_state.cx = ty->termstate.left_margin;
+ else
+ ty->cursor_state.cx = 0;
}
static void
@@ -6175,10 +6180,10 @@ _handle_esc(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
ty->cursor_state.cy++;
termpty_text_scroll_test(ty, EINA_FALSE);
return 1;
- case 'E': // add \n\r
- DBG("add \\n\\r");
+ case 'E': // NEL
+ DBG("NEL");
ty->cursor_state.wrapnext = 0;
- ty->cursor_state.cx = 0;
+ _cursor_to_start_of_line(ty);
ty->cursor_state.cy++;
termpty_text_scroll_test(ty, EINA_FALSE);
return 1;
diff --git a/tests/nel-margins.sh b/tests/nel-margins.sh
new file mode 100644
index 00000000..0833be56
--- /dev/null
+++ b/tests/nel-margins.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# clear, DECLRMM on, margins at columns 5 to 20
+printf '\033[2J\033[H\033[?69h\033[5;20s'
+# NEL inside the margins goes to the left margin
+printf '\033[3;10Hab\033Ecd'
+# NEL left of the margin goes to column 1, DECOM off
+printf '\033[6;2Hef\033Egh'
+# NEL with DECOM on: always the left margin
+printf '\033[?6h\033[3;3Hij\033Ekl\033[?6l'
+# CR left of the margin goes to column 1
+printf '\033[10;2Hmn\rop'
+# margins off: column 1
+printf '\033[?69l\033[12;10Hqr\033Est'
diff --git a/tests/tests.results b/tests/tests.results
index 637fa29f..b02b4d00 100644
--- a/tests/tests.results
+++ b/tests/tests.results
@@ -122,6 +122,7 @@ mouse_reporting_mode_normal_ext_none.sh 2978c0c8bb7bc256a6df80c055808653
mouse_reporting_mode_mouse_move_pressed_ext_none.sh a8b69a6b4a5d44b58dc6a2696709a0eb
mouse_reporting_mode_all_ext_none.sh b571cfcf6a5852b081a197b4d2d5a7cb
mouse_reporting_mode_x10_ext_utf8.sh a7dd5b0f56afa1c888659d7f3859db26
+nel-margins.sh 1fee3eef711e7b09afafcac02a35a84f
mouse_reporting_mode_normal_ext_utf8.sh e08bc1aec0f46d5ea274a32c3e225e2c
mouse_reporting_mode_mouse_move_pressed_ext_utf8.sh aa76998ac6c374848d5bed138e61bfce
mouse_reporting_mode_all_ext_utf8.sh bb5cf6ae8ae7564c1e2fc8988b5b5b19
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.