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
|
@ -420,6 +420,7 @@
|
||||||
"enter": "terminal::Enter",
|
"enter": "terminal::Enter",
|
||||||
"ctrl-c": "terminal::CtrlC",
|
"ctrl-c": "terminal::CtrlC",
|
||||||
// Useful terminal actions:
|
// Useful terminal actions:
|
||||||
|
"ctrl-cmd-space": "terminal::ShowCharacterPalette",
|
||||||
"cmd-c": "terminal::Copy",
|
"cmd-c": "terminal::Copy",
|
||||||
"cmd-v": "terminal::Paste",
|
"cmd-v": "terminal::Paste",
|
||||||
"cmd-k": "terminal::Clear"
|
"cmd-k": "terminal::Clear"
|
||||||
|
@ -428,6 +429,7 @@
|
||||||
{
|
{
|
||||||
"context": "ModalTerminal",
|
"context": "ModalTerminal",
|
||||||
"bindings": {
|
"bindings": {
|
||||||
|
"ctrl-cmd-space": "terminal::ShowCharacterPalette",
|
||||||
"shift-escape": "terminal::DeployModal"
|
"shift-escape": "terminal::DeployModal"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,17 @@ pub struct DeployContextMenu {
|
||||||
|
|
||||||
actions!(
|
actions!(
|
||||||
terminal,
|
terminal,
|
||||||
[Up, Down, CtrlC, Escape, Enter, Clear, Copy, Paste,]
|
[
|
||||||
|
Up,
|
||||||
|
Down,
|
||||||
|
CtrlC,
|
||||||
|
Escape,
|
||||||
|
Enter,
|
||||||
|
Clear,
|
||||||
|
Copy,
|
||||||
|
Paste,
|
||||||
|
ShowCharacterPalette
|
||||||
|
]
|
||||||
);
|
);
|
||||||
impl_internal_actions!(project_panel, [DeployContextMenu]);
|
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::copy);
|
||||||
cx.add_action(ConnectedView::paste);
|
cx.add_action(ConnectedView::paste);
|
||||||
cx.add_action(ConnectedView::clear);
|
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
|
///A terminal view, maintains the PTY's file handles and communicates with the terminal
|
||||||
|
@ -126,6 +137,10 @@ impl ConnectedView {
|
||||||
cx.notify();
|
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>) {
|
fn clear(&mut self, _: &Clear, cx: &mut ViewContext<Self>) {
|
||||||
self.terminal.update(cx, |term, _| term.clear());
|
self.terminal.update(cx, |term, _| term.clear());
|
||||||
cx.notify();
|
cx.notify();
|
||||||
|
|
|
@ -53,7 +53,6 @@ pub fn to_esc_str(keystroke: &Keystroke, mode: &TermMode) -> Option<String> {
|
||||||
// Manual Bindings including modifiers
|
// Manual Bindings including modifiers
|
||||||
let manual_esc_str = match (keystroke.key.as_ref(), &modifiers) {
|
let manual_esc_str = match (keystroke.key.as_ref(), &modifiers) {
|
||||||
//Basic special keys
|
//Basic special keys
|
||||||
("space", Modifiers::None) => Some(" ".to_string()),
|
|
||||||
("tab", Modifiers::None) => Some("\x09".to_string()),
|
("tab", Modifiers::None) => Some("\x09".to_string()),
|
||||||
("escape", Modifiers::None) => Some("\x1b".to_string()),
|
("escape", Modifiers::None) => Some("\x1b".to_string()),
|
||||||
("enter", Modifiers::None) => Some("\x0d".to_string()),
|
("enter", Modifiers::None) => Some("\x0d".to_string()),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue