Skip to content

Commit f18fed9

Browse files
authored
Fix StickyMessages for non-ASCII messages (#5)
1 parent 4a56cd7 commit f18fed9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/StickyMessages.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function showsticky(io, prev_nlines, messages)
7171
for i = 1:length(messages)-1
7272
write(iob, messages[i][2])
7373
end
74-
write(iob, messages[end][2][1:end-1])
74+
write(iob, chop(messages[end][2]))
7575
end
7676
# TODO: Ideally we'd query the terminal for the line it was on before doing
7777
# all this and restore it if it's not in the new non-scrollable region.

test/StickyMessages.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,8 @@ end
3535
"\e[20;1H\e[J\e[1;20r\e[19;1H"
3636
pop!(stickies, :b)
3737
@test String(take!(buf)) == ""
38+
39+
push!(stickies, :a=>"αβγ\n")
40+
@test String(take!(buf)) == #scroll #csr #pos #msg #pos
41+
"\e[20;1H\n\e[1;19r\e[20;1Hαβγ\e[19;1H"
3842
end

0 commit comments

Comments
 (0)