mirror of
https://github.com/wez/wezterm.git
synced 2024-12-23 13:21:38 +03:00
Respond to DECRQM 2027 - grapheme clustering
closes: https://github.com/wez/wezterm/issues/4320
This commit is contained in:
parent
bf545f1cc1
commit
33e727b074
@ -1345,6 +1345,22 @@ impl TerminalState {
|
||||
}
|
||||
}
|
||||
|
||||
/// Indicates that mode is permanently enabled
|
||||
fn decqrm_response_permanent(&mut self, mode: Mode) {
|
||||
let (is_dec, number) = match &mode {
|
||||
Mode::QueryDecPrivateMode(DecPrivateMode::Code(code)) => (true, code.to_u16().unwrap()),
|
||||
Mode::QueryDecPrivateMode(DecPrivateMode::Unspecified(code)) => (true, *code),
|
||||
Mode::QueryMode(TerminalMode::Code(code)) => (false, code.to_u16().unwrap()),
|
||||
Mode::QueryMode(TerminalMode::Unspecified(code)) => (false, *code),
|
||||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
let prefix = if is_dec { "?" } else { "" };
|
||||
|
||||
write!(self.writer, "\x1b[{prefix}{number};3$y").ok();
|
||||
self.writer.flush().ok();
|
||||
}
|
||||
|
||||
fn decqrm_response(&mut self, mode: Mode, mut recognized: bool, enabled: bool) {
|
||||
let (is_dec, number) = match &mode {
|
||||
Mode::QueryDecPrivateMode(DecPrivateMode::Code(code)) => (true, code.to_u16().unwrap()),
|
||||
@ -1449,6 +1465,21 @@ impl TerminalState {
|
||||
self.decqrm_response(mode, true, self.left_and_right_margin_mode);
|
||||
}
|
||||
|
||||
Mode::SetDecPrivateMode(DecPrivateMode::Code(
|
||||
DecPrivateModeCode::GraphemeClustering,
|
||||
))
|
||||
| Mode::ResetDecPrivateMode(DecPrivateMode::Code(
|
||||
DecPrivateModeCode::GraphemeClustering,
|
||||
)) => {
|
||||
// Permanently enabled
|
||||
}
|
||||
|
||||
Mode::QueryDecPrivateMode(DecPrivateMode::Code(
|
||||
DecPrivateModeCode::GraphemeClustering,
|
||||
)) => {
|
||||
self.decqrm_response_permanent(mode);
|
||||
}
|
||||
|
||||
Mode::SetDecPrivateMode(DecPrivateMode::Code(DecPrivateModeCode::SaveCursor)) => {
|
||||
self.dec_save_cursor();
|
||||
}
|
||||
|
@ -841,6 +841,11 @@ pub enum DecPrivateModeCode {
|
||||
EnableAlternateScreen = 47,
|
||||
OptEnableAlternateScreen = 1047,
|
||||
BracketedPaste = 2004,
|
||||
|
||||
/// <https://github.com/contour-terminal/terminal-unicode-core/>
|
||||
/// Grapheme clustering mode
|
||||
GraphemeClustering = 2027,
|
||||
|
||||
/// Applies to sixel and regis modes
|
||||
UsePrivateColorRegistersForEachGraphic = 1070,
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user