Skip to content

Commit

Permalink
Default G1 to ASCII
Browse files Browse the repository at this point in the history
As per DEC STD-070 3.6.4

refs: #3962
  • Loading branch information
ninjalj authored and wez committed Nov 7, 2023
1 parent d680953 commit f880188
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions term/src/terminalstate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ impl TerminalState {
last_mouse_move: None,
cursor_visible: true,
g0_charset: CharSet::Ascii,
g1_charset: CharSet::DecLineDrawing,
g1_charset: CharSet::Ascii,
shift_out: false,
newline_mode: false,
current_mouse_buttons: vec![],
Expand Down Expand Up @@ -1253,6 +1253,9 @@ impl TerminalState {
self.reverse_video_mode = false;
self.bidi_enabled.take();
self.bidi_hint.take();

self.g0_charset = CharSet::Ascii;
self.g1_charset = CharSet::Ascii;
}
Device::RequestPrimaryDeviceAttributes => {
let mut ident = "\x1b[?65".to_string(); // Vt500
Expand Down Expand Up @@ -2581,7 +2584,7 @@ impl TerminalState {
pen: Default::default(),
dec_origin_mode: false,
g0_charset: CharSet::Ascii,
g1_charset: CharSet::DecLineDrawing,
g1_charset: CharSet::Ascii,
});
debug!(
"restore cursor {:?} is_alt={}",
Expand Down
2 changes: 1 addition & 1 deletion term/src/terminalstate/performer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ impl<'a> Performer<'a> {
self.current_mouse_buttons.clear();
self.cursor_visible = true;
self.g0_charset = CharSet::Ascii;
self.g1_charset = CharSet::DecLineDrawing;
self.g1_charset = CharSet::Ascii;
self.shift_out = false;
self.newline_mode = false;
self.tabs = TabStop::new(self.screen().physical_cols, 8);
Expand Down
2 changes: 1 addition & 1 deletion term/src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ fn test_dec_special_graphics() {
);

term = TestTerm::new(2, 50, 0);
term.print("\u{0e}SO-ABCabcdefghijklmnopqrstuvwxyzDEF\r\n\u{0f}SI-hello");
term.print("\u{1b})0\u{0e}SO-ABCabcdefghijklmnopqrstuvwxyzDEF\r\n\u{0f}SI-hello");
assert_visible_contents(
&term,
file!(),
Expand Down

0 comments on commit f880188

Please sign in to comment.