File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
app/src/main/java/com/termux/app
terminal-view/src/main/java/com/termux/view Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -611,7 +611,7 @@ public boolean onContextItemSelected(MenuItem item) {
611
611
requestAutoFill ();
612
612
return true ;
613
613
case CONTEXT_MENU_RESET_TERMINAL_ID :
614
- resetSession (session );
614
+ onResetTerminalSession (session );
615
615
return true ;
616
616
case CONTEXT_MENU_KILL_PROCESS_ID :
617
617
showKillSessionDialog (session );
@@ -650,10 +650,13 @@ private void showKillSessionDialog(TerminalSession session) {
650
650
b .show ();
651
651
}
652
652
653
- private void resetSession (TerminalSession session ) {
653
+ private void onResetTerminalSession (TerminalSession session ) {
654
654
if (session != null ) {
655
655
session .reset ();
656
656
showToast (getResources ().getString (R .string .msg_terminal_reset ), true );
657
+
658
+ if (mTermuxTerminalSessionClient != null )
659
+ mTermuxTerminalSessionClient .onResetTerminalSession ();
657
660
}
658
661
}
659
662
Original file line number Diff line number Diff line change @@ -205,6 +205,15 @@ public void onTerminalCursorStateChange(boolean enabled) {
205
205
mActivity .getTerminalView ().setTerminalCursorBlinkerState (enabled , false );
206
206
}
207
207
208
+ /**
209
+ * Should be called when mActivity.onResetTerminalSession() is called
210
+ */
211
+ public void onResetTerminalSession () {
212
+ // Ensure blinker starts again after reset if cursor blinking was disabled before reset like
213
+ // with "tput civis" which would have called onTerminalCursorStateChange()
214
+ mActivity .getTerminalView ().setTerminalCursorBlinkerState (true , true );
215
+ }
216
+
208
217
209
218
210
219
@ Override
Original file line number Diff line number Diff line change @@ -905,6 +905,10 @@ public synchronized boolean setTerminalCursorBlinkerRate(int blinkRate) {
905
905
* to be shown. It should also be checked if activity is visible if blinker is to be started
906
906
* before calling this.
907
907
*
908
+ * It should also be called after terminal is reset with {@link TerminalSession#reset()} in case
909
+ * cursor blinker was disabled before reset due to call to
910
+ * {@link com.termux.terminal.TerminalSessionClient#onTerminalCursorStateChange(boolean)}.
911
+ *
908
912
* How cursor blinker starting works is by registering a {@link Runnable} with the looper of
909
913
* the main thread of the app which when run, toggles the cursor blinking state and re-registers
910
914
* itself to be called with the delay set by {@link #mTerminalCursorBlinkerRate}. When cursor
You can’t perform that action at this time.
0 commit comments