Add pshell integration and clean up text editor code

This commit is contained in:
kake26 2025-04-30 17:15:28 -05:00
parent a5de997cfa
commit 15256a982e
Signed by: kake26
GPG key ID: E0A989B571D1F99F
4 changed files with 577 additions and 113 deletions

13
pshell.kpd Normal file
View 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;