From 0a4affee66ff980f7bc43a6002fc448a85058d37 Mon Sep 17 00:00:00 2001 From: "Vojtech Duchon (Ext)" Date: Tue, 12 Oct 2021 08:49:54 +0200 Subject: [PATCH] Allow multiline commands in Custom Commands plugin --- terminatorlib/plugins/custom_commands.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/terminatorlib/plugins/custom_commands.py b/terminatorlib/plugins/custom_commands.py index fa16e618..e624358e 100644 --- a/terminatorlib/plugins/custom_commands.py +++ b/terminatorlib/plugins/custom_commands.py @@ -305,8 +305,8 @@ class CustomCommandsMenu(plugin.MenuItem): label = Gtk.Label(label=_("Command:")) table.attach(label, 0, 1, 2, 3) - command = Gtk.Entry() - command.set_text(command_var) + command = Gtk.TextView() + command.get_buffer().set_text(command_var) table.attach(command, 1, 2, 2, 3) dialog.vbox.pack_start(table, True, True, 0) @@ -320,7 +320,7 @@ class CustomCommandsMenu(plugin.MenuItem): if res == Gtk.ResponseType.ACCEPT: item['enabled'] = enabled.get_active() item['name'] = name.get_text() - item['command'] = command.get_text() + item['command'] = command.get_buffer().get_text(command.get_buffer().get_start_iter(), command.get_buffer().get_end_iter(), True) if item['name'] == '' or item['command'] == '': err = Gtk.MessageDialog(dialog, Gtk.DialogFlags.MODAL, @@ -430,7 +430,7 @@ class CustomCommandsMenu(plugin.MenuItem): if res == Gtk.ResponseType.ACCEPT: item['enabled'] = enabled.get_active() item['name'] = name.get_text() - item['command'] = command.get_text() + item['command'] = command.get_buffer().get_text(command.get_buffer().get_start_iter(), command.get_buffer().get_end_iter(), True) if item['name'] == '' or item['command'] == '': err = Gtk.MessageDialog(dialog, Gtk.DialogFlags.MODAL,