From a80b32d006b24512bb8bd6c4d362f90abb4388d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 28 Feb 2025 08:11:50 +0100 Subject: [PATCH] term: tweak linebreaking Don't set linebreak on linefeed. Instead, rely on the default value of true, and that it is only cleared when a character is printed while LCF=1. Note that printing to a row that has linebreak cleared, will set the linebreak flag again. --- CHANGELOG.md | 6 ++++++ terminal.c | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 152b7728..cb3ae470 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -93,8 +93,14 @@ based. * Rename Tokyo Night Day theme to Tokyo Night Light and update colors. * fcft >= 3.2.0 is now required. +* Linefeed:ing control characters (e.g. `\n`) no longer **clears** a + row's internal linebreak flag. This fixes an issue where + e.g. multi-line prompt input in fish is treated as separate lines, + rather than one logical, when selecting and copying it + ([#1487][1487]). [1925]: https://codeberg.org/dnkl/foot/issues/1925 +[1487]: https://codeberg.org/dnkl/foot/issues/1487 ### Deprecated diff --git a/terminal.c b/terminal.c index 1c607787..988716f4 100644 --- a/terminal.c +++ b/terminal.c @@ -3191,7 +3191,6 @@ term_carriage_return(struct terminal *term) void term_linefeed(struct terminal *term) { - term->grid->cur_row->linebreak = true; term->grid->cursor.lcf = false; if (term->grid->cursor.point.row == term->scroll_region.end - 1)