@@ -961,28 +961,32 @@ - (void)initializeUIStyleForDarkMode:(BOOL)isDark {
961961
962962 NSColor *secondaryTextColor = [[self class ] secondaryTextColor ];
963963
964- NSMutableDictionary *attrs = [[NSMutableDictionary alloc ] init ];
964+ NSMutableDictionary *defaultAttrs = [[NSMutableDictionary alloc ] init ];
965+ // solve terminal hijack when non-inline
966+ defaultAttrs[IMKCandidatesSendServerKeyEventFirst] = @(YES );
967+
968+ NSMutableDictionary *attrs = [defaultAttrs mutableCopy ];
965969 attrs[NSForegroundColorAttributeName ] = [NSColor controlTextColor ];
966970 attrs[NSFontAttributeName ] = [NSFont userFontOfSize: kDefaultFontSize ];
967971
968- NSMutableDictionary *highlightedAttrs = [[ NSMutableDictionary alloc ] init ];
972+ NSMutableDictionary *highlightedAttrs = [defaultAttrs mutableCopy ];
969973 highlightedAttrs[NSForegroundColorAttributeName ] = [NSColor selectedControlTextColor ];
970974 highlightedAttrs[NSFontAttributeName ] = [NSFont userFontOfSize: kDefaultFontSize ];
971975
972976 NSMutableDictionary *labelAttrs = [attrs mutableCopy ];
973977 NSMutableDictionary *labelHighlightedAttrs = [highlightedAttrs mutableCopy ];
974978
975- NSMutableDictionary *commentAttrs = [[ NSMutableDictionary alloc ] init ];
979+ NSMutableDictionary *commentAttrs = [defaultAttrs mutableCopy ];
976980 commentAttrs[NSForegroundColorAttributeName ] = secondaryTextColor;
977981 commentAttrs[NSFontAttributeName ] = [NSFont userFontOfSize: kDefaultFontSize ];
978982
979983 NSMutableDictionary *commentHighlightedAttrs = [commentAttrs mutableCopy ];
980984
981- NSMutableDictionary *preeditAttrs = [[ NSMutableDictionary alloc ] init ];
985+ NSMutableDictionary *preeditAttrs = [defaultAttrs mutableCopy ];
982986 preeditAttrs[NSForegroundColorAttributeName ] = secondaryTextColor;
983987 preeditAttrs[NSFontAttributeName ] = [NSFont userFontOfSize: kDefaultFontSize ];
984988
985- NSMutableDictionary *preeditHighlightedAttrs = [[ NSMutableDictionary alloc ] init ];
989+ NSMutableDictionary *preeditHighlightedAttrs = [defaultAttrs mutableCopy ];
986990 preeditHighlightedAttrs[NSForegroundColorAttributeName ] = [NSColor controlTextColor ];
987991 preeditHighlightedAttrs[NSFontAttributeName ] = [NSFont userFontOfSize: kDefaultFontSize ];
988992
0 commit comments