Added show character palette. Need to position correctly.
This commit is contained in:
parent
1f82c0c8bf
commit
bf7b3150e4
3 changed files with 18 additions and 2 deletions
|
@ -29,7 +29,17 @@ pub struct DeployContextMenu {
|
|||
|
||||
actions!(
|
||||
terminal,
|
||||
[Up, Down, CtrlC, Escape, Enter, Clear, Copy, Paste,]
|
||||
[
|
||||
Up,
|
||||
Down,
|
||||
CtrlC,
|
||||
Escape,
|
||||
Enter,
|
||||
Clear,
|
||||
Copy,
|
||||
Paste,
|
||||
ShowCharacterPalette
|
||||
]
|
||||
);
|
||||
impl_internal_actions!(project_panel, [DeployContextMenu]);
|
||||
|
||||
|
@ -45,6 +55,7 @@ pub fn init(cx: &mut MutableAppContext) {
|
|||
cx.add_action(ConnectedView::copy);
|
||||
cx.add_action(ConnectedView::paste);
|
||||
cx.add_action(ConnectedView::clear);
|
||||
cx.add_action(ConnectedView::show_character_palette);
|
||||
}
|
||||
|
||||
///A terminal view, maintains the PTY's file handles and communicates with the terminal
|
||||
|
@ -126,6 +137,10 @@ impl ConnectedView {
|
|||
cx.notify();
|
||||
}
|
||||
|
||||
fn show_character_palette(&mut self, _: &ShowCharacterPalette, cx: &mut ViewContext<Self>) {
|
||||
cx.show_character_palette();
|
||||
}
|
||||
|
||||
fn clear(&mut self, _: &Clear, cx: &mut ViewContext<Self>) {
|
||||
self.terminal.update(cx, |term, _| term.clear());
|
||||
cx.notify();
|
||||
|
|
|
@ -53,7 +53,6 @@ pub fn to_esc_str(keystroke: &Keystroke, mode: &TermMode) -> Option<String> {
|
|||
// Manual Bindings including modifiers
|
||||
let manual_esc_str = match (keystroke.key.as_ref(), &modifiers) {
|
||||
//Basic special keys
|
||||
("space", Modifiers::None) => Some(" ".to_string()),
|
||||
("tab", Modifiers::None) => Some("\x09".to_string()),
|
||||
("escape", Modifiers::None) => Some("\x1b".to_string()),
|
||||
("enter", Modifiers::None) => Some("\x0d".to_string()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue