Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal compatibility: various behaviour fixes #486

Merged
merged 3 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
style(fmt): thanks clippy for teaching me about matches!
  • Loading branch information
imsnif committed May 11, 2021
commit 7edc2af4f70c599c385fd09444f9a76051d40c96
5 changes: 1 addition & 4 deletions src/client/panes/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1262,10 +1262,7 @@ impl Perform for Grid {
self.advance_to_next_tabstop(self.cursor.pending_styles);
}
} else if c == 'q' {
let first_intermediate_is_space = match intermediates.get(0) {
Some(b' ') => true,
_ => false,
};
let first_intermediate_is_space = matches!(intermediates.get(0), Some(b' '));
if first_intermediate_is_space {
// DECSCUSR (CSI Ps SP q) -- Set Cursor Style.
let cursor_style_id = next_param_or(0);
Expand Down
24 changes: 6 additions & 18 deletions src/client/panes/terminal_pane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,24 +293,12 @@ impl Pane for TerminalPane {
}
fn cursor_shape_csi(&self) -> String {
match self.grid.cursor_shape() {
CursorShape::Block => {
format!("\u{1b}[0 q")
}
CursorShape::BlinkingBlock => {
format!("\u{1b}[1 q")
}
CursorShape::Underline => {
format!("\u{1b}[4 q")
}
CursorShape::BlinkingUnderline => {
format!("\u{1b}[3 q")
}
CursorShape::Beam => {
format!("\u{1b}[6 q")
}
CursorShape::BlinkingBeam => {
format!("\u{1b}[5 q")
}
CursorShape::Block => "\u{1b}[0 q".to_string(),
CursorShape::BlinkingBlock => "\u{1b}[1 q".to_string(),
CursorShape::Underline => "\u{1b}[4 q".to_string(),
CursorShape::BlinkingUnderline => "\u{1b}[3 q".to_string(),
CursorShape::Beam => "\u{1b}[6 q".to_string(),
CursorShape::BlinkingBeam => "\u{1b}[5 q".to_string(),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/client/tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ pub trait Pane {
fn active_at(&self) -> Instant;
fn set_active_at(&mut self, instant: Instant);
fn cursor_shape_csi(&self) -> String {
format!("\u{1b}[0 q") // default to non blinking block
"\u{1b}[0 q".to_string() // default to non blinking block
}

fn right_boundary_x_coords(&self) -> usize {
Expand Down