Add pshell integration and clean up text editor code
This commit is contained in:
parent
a5de997cfa
commit
15256a982e
4 changed files with 577 additions and 113 deletions
13
pshell.kpd
Normal file
13
pshell.kpd
Normal file
|
@ -0,0 +1,13 @@
|
|||
::RunPshellCmd::
|
||||
use strict;
|
||||
my $dialog = Gtk3::Dialog->new('Run pshell Command', $::window, 'modal', 'gtk-ok', 'ok', 'gtk-cancel', 'cancel');
|
||||
my $entry = Gtk3::Entry->new;
|
||||
$dialog->get_content_area->pack_start($entry, FALSE, FALSE, 0);
|
||||
$dialog->show_all;
|
||||
if ($dialog->run eq 'ok') {
|
||||
my $cmd = $entry->get_text;
|
||||
my $output = `$::basedir/pshell -e "$cmd" 2>&1` || "Error: pshell failed";
|
||||
$::textbuffer->insert_at_cursor("pshell output:\n$output\n");
|
||||
$::statusbar->push(0, "Ran pshell command");
|
||||
}
|
||||
$dialog->destroy;
|
Loading…
Add table
Add a link
Reference in a new issue