summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Hood <cgull@glup.org>2017-03-26 21:27:38 -0400
committerJohn Hood <cgull@glup.org>2017-04-24 22:40:31 -0400
commit2873def506f3ee0a16ed7ed5636d676524b7d4d4 (patch)
tree682aede69228922da4e77db869dde87680173cf2
parentaa74af9a34402f8a4976888e4da7ae034378587b (diff)
Work around JuiceSSH rendering bug
JuiceSSH apparently has a bug where ECH for one character (ESC [ 1 X) does not actually erase the character, in its code that receives and interprets Mosh state updates. This was hidden before because Mosh <= 1.2.5 never sent this sequence, it sent ESC [ X instead as an optimization. Do the better optimization of sending spaces for short sequences of blanks instead.
-rw-r--r--src/terminal/terminaldisplay.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/terminal/terminaldisplay.cc b/src/terminal/terminaldisplay.cc
index 81fbd9f..74d662e 100644
--- a/src/terminal/terminaldisplay.cc
+++ b/src/terminal/terminaldisplay.cc
@@ -386,7 +386,7 @@ bool Display::put_row( bool initialized, FrameState &frame, const Framebuffer &f
frame.append_silent_move( frame_y, frame_x - clear_count );
frame.update_rendition( blank_renditions );
bool can_use_erase = has_bce || ( frame.current_rendition == initial_rendition() );
- if ( can_use_erase && has_ech ) {
+ if ( can_use_erase && has_ech && clear_count > 4 ) {
snprintf( tmp, 64, "\033[%dX", clear_count );
frame.append( tmp );
} else {
@@ -436,8 +436,8 @@ bool Display::put_row( bool initialized, FrameState &frame, const Framebuffer &f
frame.append_silent_move( frame_y, frame_x - clear_count );
frame.update_rendition( blank_renditions );
- bool can_use_erase = !wrap_this && ( has_bce || ( frame.current_rendition == initial_rendition() ) );
- if ( can_use_erase ) {
+ bool can_use_erase = has_bce || ( frame.current_rendition == initial_rendition() );
+ if ( can_use_erase && !wrap_this ) {
frame.append( "\033[K" );
} else {
frame.append( clear_count, ' ' );