File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ impl Reedline {
240240 buffer_editor : None ,
241241 cursor_shapes : None ,
242242 bracketed_paste : BracketedPasteGuard :: default ( ) ,
243- kitty_protocol : KittyProtocolGuard :: default ( ) ,
243+ kitty_protocol : KittyProtocolGuard :: new ( ) ,
244244 immediately_accept : false ,
245245 #[ cfg( feature = "external_printer" ) ]
246246 external_printer : None ,
Original file line number Diff line number Diff line change @@ -12,15 +12,23 @@ use crossterm::{event, execute};
1212/// * [dte text editor](https://gitlab.com/craigbarnes/dte/-/issues/138)
1313///
1414/// Refer to <https://sw.kovidgoyal.net/kitty/keyboard-protocol/> if you're curious.
15- #[ derive( Default ) ]
1615pub ( crate ) struct KittyProtocolGuard {
1716 enabled : bool ,
1817 active : bool ,
18+ support_kitty_protocol : bool ,
1919}
2020
2121impl KittyProtocolGuard {
22+ pub fn new ( ) -> Self {
23+ Self {
24+ support_kitty_protocol : super :: kitty_protocol_available ( ) ,
25+ enabled : false ,
26+ active : false ,
27+ }
28+ }
29+
2230 pub fn set ( & mut self , enable : bool ) {
23- self . enabled = enable && super :: kitty_protocol_available ( ) ;
31+ self . enabled = enable && self . support_kitty_protocol ;
2432 }
2533 pub fn enter ( & mut self ) {
2634 if self . enabled && !self . active {
You can’t perform that action at this time.
0 commit comments