@@ -18,32 +18,31 @@ pub(super) struct Term {
1818
1919impl Term {
2020 pub ( super ) fn start ( ) -> Result < Self > {
21- static SKIP : SyncCell < bool > = SyncCell :: new ( false ) ;
2221 let mut term = Self {
2322 inner : Terminal :: new ( CrosstermBackend :: new ( TTY . writer ( ) ) ) ?,
2423 last_area : Default :: default ( ) ,
2524 last_buffer : Default :: default ( ) ,
2625 } ;
2726
2827 enable_raw_mode ( ) ?;
29- if SKIP . replace ( true ) && yazi_adapter:: TMUX . get ( ) {
28+ static FIRST : SyncCell < bool > = SyncCell :: new ( false ) ;
29+ if FIRST . replace ( true ) && yazi_adapter:: TMUX . get ( ) {
3030 yazi_adapter:: Mux :: tmux_passthrough ( ) ;
3131 }
3232
3333 execute ! (
3434 TTY . writer( ) ,
3535 yazi_term:: If ( !TMUX . get( ) , EnterAlternateScreen ) ,
3636 Print ( "\x1b P$q q\x1b \\ " ) , // Request cursor shape (DECRQSS query for DECSCUSR)
37- Print ( Mux :: csi ( "\x1b [?12$p" ) ) , // Request cursor blink status (DECRQM query for DECSET 12)
37+ Print ( "\x1b [?12$p" ) , // Request cursor blink status (DECRQM query for DECSET 12)
3838 Print ( "\x1b [?u" ) , // Request keyboard enhancement flags (CSI u)
39- Print ( Mux :: csi ( "\x1b [0c" ) ) , // Request device attributes
39+ Print ( "\x1b [0c" ) , // Request device attributes
4040 yazi_term:: If ( TMUX . get( ) , EnterAlternateScreen ) ,
4141 EnableBracketedPaste ,
4242 yazi_term:: If ( !YAZI . mgr. mouse_events. get( ) . is_empty( ) , EnableMouseCapture ) ,
4343 ) ?;
4444
4545 let resp = Emulator :: read_until_da1 ( ) ;
46- Mux :: tmux_drain ( ) ?;
4746 yazi_term:: RestoreCursor :: store ( & resp) ;
4847
4948 CSI_U . store ( resp. contains ( "\x1b [?0u" ) , Ordering :: Relaxed ) ;
@@ -62,6 +61,7 @@ impl Term {
6261 term. hide_cursor ( ) ?;
6362 term. clear ( ) ?;
6463 term. flush ( ) ?;
64+ Mux :: tmux_drain ( ) ?;
6565 Ok ( term)
6666 }
6767
0 commit comments