Skip to content

Commit

Permalink
fix CopyTab=yes crash condition (#1269)
Browse files Browse the repository at this point in the history
  • Loading branch information
mintty committed Jun 13, 2024
1 parent 3e654f8 commit a79e7dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/termclip.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 79,7 @@ clip_addchar(clip_workbuf * b, wchar chr, cattr * ca, bool tabs, ulong sizehint)
}

cattr copattr = ca ? *ca : CATTR_DEFAULT;
//printf("setting clipbuf[%ld] = X\n", b->len, chr);
if (copattr.attr & TATTR_CLEAR) {
copattr.attr &= ~(ATTR_BOLD | ATTR_DIM | TATTR_CLEAR);
}
Expand All @@ -97,6 98,8 @@ get_selection(bool attrs, pos start, pos end, bool rect, bool allinline, bool wi
{
//printf("get_selection attrs %d all %d tabs %d\n", attrs, allinline, with_tabs);

if (with_tabs)
attrs = true; // ensure we can check expanded TABs (#1269)
clip_workbuf *buf = newn(clip_workbuf, 1);
*buf = (clip_workbuf){.with_attrs = attrs,
.capacity = 0, .len = 0, .text = 0, .cattrs = 0};
Expand Down
1 change: 1 addition & 0 deletions wiki/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 17,7 @@ Keyboard handling

Misc
* Support fallback to legacy wslbridge for old Windows versions (mintty/wsltty#350).
* Fix CopyTab=yes crash condition (#1269).

Desktop integration
* Avoid taskbar icon width twitching in Windows 11 (#1263).
Expand Down

0 comments on commit a79e7dd

Please sign in to comment.