Skip to content

Commit cc5e069

Browse files
authored
Fix bug causing kitty protocol escape sequences to break multiline (#863)
Reproducer (must be run in kitty or another terminal with support for kitty's escape sequences[*]): $ PS1=$'\E[4:5m→\E[0m ' → <Enter a command prompt spanning multiple lines> → <Home> + <End> The bottom line shifts over two characters more than it ought. This is because the ':' in the escape sequence causes ksh to calculate the wrong length for the sequence. - Continue calculating the length of the escape sequence after encountering a ':' in the sequence. [*]: https://sw.kovidgoyal.net/kitty/underlines/
1 parent af5ae2e commit cc5e069

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

NEWS

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@ This documents significant changes in the dev branch of ksh 93u+m.
22
For full details, see the git log at: https://github.com/ksh93/ksh
33
Uppercase BUG_* IDs are shell bug IDs as used by the Modernish shell library.
44

5-
2025-07-30:
5+
2025-05-31:
6+
7+
- Fixed a bug that caused the multiline option to break when PS*
8+
prompts use the kitty terminal's escape sequence (e.g. $'\E[4:4m'
9+
in the PS1 prompt for formatting spaced dots).
10+
11+
2025-05-30:
612

713
- The editor typeahead buffer and the limit for the ${.sh.edchar} variable
814
(used with the KEYBD trap) has been increased from 80 to 500 bytes.
915

10-
2025-07-29:
16+
2025-05-29:
1117

1218
- Fixed a serious but rarely occurring regression that corrupts variable
1319
names in assignments. It could be triggered in large scripts and cause a

src/cmd/ksh93/edit/edit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ void ed_setup(Edit_t *ep, int fd, int reedit)
420420
skip = 0;
421421
continue;
422422
}
423-
if(n==3 && (c=='?' || c=='!'))
423+
if(n==3 && (c=='?' || c=='!' || c==':'))
424424
continue;
425425
else if(n>1 && c==';')
426426
skip = 1;

src/cmd/ksh93/include/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <ast_release.h>
1919
#include "git.h"
2020

21-
#define SH_RELEASE_DATE "2025-05-30" /* must be in this format for $((.sh.version)) */
21+
#define SH_RELEASE_DATE "2025-05-31" /* must be in this format for $((.sh.version)) */
2222
/*
2323
* This comment keeps SH_RELEASE_DATE a few lines away from SH_RELEASE_SVER to avoid
2424
* merge conflicts when cherry-picking dev branch commits onto a release branch.

0 commit comments

Comments
 (0)