@@ -1143,6 +1143,7 @@ private void UpdateHistoryDuringInteractiveSearch(string toMatch, int direction,
1143
1143
? HistoryMoveCursor . ToEnd
1144
1144
: HistoryMoveCursor . DontMove ;
1145
1145
UpdateFromHistory ( moveCursor ) ;
1146
+ SafeRender ( $ "\x1b [s;[1E;[K{ _statusLinePrompt } { toMatch } _\x1b [u") ;
1146
1147
return ;
1147
1148
}
1148
1149
}
@@ -1157,7 +1158,8 @@ private void UpdateHistoryDuringInteractiveSearch(string toMatch, int direction,
1157
1158
_emphasisStart = - 1 ;
1158
1159
_emphasisLength = 0 ;
1159
1160
_statusLinePrompt = direction > 0 ? _failedForwardISearchPrompt : _failedBackwardISearchPrompt ;
1160
- Render ( ) ;
1161
+ // Deletes the original status line and then renders the new one
1162
+ SafeRender ( $ "\x1b [s;[1E;[K{ _statusLinePrompt } { toMatch } _\x1b [u") ;
1161
1163
}
1162
1164
1163
1165
private void InteractiveHistorySearchLoop ( int direction )
@@ -1193,6 +1195,7 @@ private void InteractiveHistorySearchLoop(int direction)
1193
1195
{
1194
1196
toMatch . Remove ( toMatch . Length - 1 , 1 ) ;
1195
1197
_statusBuffer . Remove ( _statusBuffer . Length - 2 , 1 ) ;
1198
+ SafeRender ( $ "\x1b [s;[1E;[{ _statusLinePrompt . Length + toMatch . Length } C\x1b [P;[u") ;
1196
1199
searchPositions . Pop ( ) ;
1197
1200
searchFromPoint = _currentHistoryIndex = searchPositions . Peek ( ) ;
1198
1201
var moveCursor = Options . HistorySearchCursorMovesToEnd
@@ -1223,7 +1226,8 @@ private void InteractiveHistorySearchLoop(int direction)
1223
1226
_current = startIndex ;
1224
1227
_emphasisStart = startIndex ;
1225
1228
_emphasisLength = toMatch . Length ;
1226
- Render ( ) ;
1229
+ // Deletes the original status line prompt and then renders the new one
1230
+ SafeRender ( $ "\x1b [s;[1E;[K{ _statusLinePrompt } { toMatch } _\x1b [u") ;
1227
1231
}
1228
1232
}
1229
1233
else
@@ -1264,7 +1268,7 @@ private void InteractiveHistorySearchLoop(int direction)
1264
1268
_current = startIndex ;
1265
1269
_emphasisStart = startIndex ;
1266
1270
_emphasisLength = toMatch . Length ;
1267
- Render ( ) ;
1271
+ SafeRender ( toAppend . ToString ( ) ) ;
1268
1272
}
1269
1273
searchPositions . Push ( _currentHistoryIndex ) ;
1270
1274
}
@@ -1280,13 +1284,15 @@ private void InteractiveHistorySearch(int direction)
1280
1284
_statusLinePrompt = direction > 0 ? _forwardISearchPrompt : _backwardISearchPrompt ;
1281
1285
_statusBuffer . Append ( "_" ) ;
1282
1286
1283
- Render ( ) ; // Render prompt
1287
+ // Saves cursor, renders new line with status prompt, restores cursor
1288
+ SafeRender ( $ "\x1b [s\n { _statusLinePrompt } _\x1b [u") ;
1284
1289
InteractiveHistorySearchLoop ( direction ) ;
1285
1290
1286
1291
_emphasisStart = - 1 ;
1287
1292
_emphasisLength = 0 ;
1288
1293
1289
1294
// Remove our status line, this will render
1295
+ // TODO: Evaluate this under a screen reader
1290
1296
ClearStatusMessage ( render : true ) ;
1291
1297
}
1292
1298
0 commit comments