Skip to content

Commit 3c2ccb0

Browse files
authored
[1/3] Update lxterminal.h: multiple --command=, run multiple commands from the command line
The reader is kindly asked to pay attention for the s letter, or absent of, and to the = character, or absent of, in the seemingly no difference --command, --command= and --commands= terms. In what follows, these 3 different terms are totally different. With the current stable implementation, with multiple --command= command line options, only the last one was used. It override the previous occurrences of --command=. As promised at lxde#98 (comment), this code modifies that. With it, all the commands specified with --command= option will run. Each one at a different tab. Each command is automatically paired with a tab. After exhausting existing tabs, new tabs will be automatically created. This feature does not lift the basic limitation of commands in lxterminal command line. Which is, that short lived processes makes the tab they ran within, or the whole window in case of only short lived processes, to get closed as soon as the short lived processes have terminated. This limitation is shortly described in the modified man page. This patch constitutes of modifying 3 files: 1. src/lxterminal.h 2. src/lxterminal.c 3. man/lxterminal.xml Lightly tested. The modification of lxterminal.xml, beside describing the new behavior of the --command= option, also describes, in some length, some pitfalls of lxterminal.
1 parent 8e30edd commit 3c2ccb0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lxterminal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ typedef struct _term {
7070
GtkWidget * scrollbar; /* Scroll bar, child of horizontal box */
7171
GPid pid; /* Process ID of the process that has this as its terminal */
7272
GClosure * closure; /* Accelerator structure */
73+
gchar * * command; /* Memory allocated by glib */
7374
gchar * matched_url;
7475
gboolean open_menu_on_button_release;
7576
gulong exit_handler_id;
@@ -79,6 +80,7 @@ typedef struct _term {
7980
typedef struct _command_arguments {
8081
char * executable; /* Value of argv[0]; points into argument vector */
8182
gchar * * command; /* Value of -e, --command; memory allocated by glib */
83+
gchar * * commands; /* Accumulated values of --command=; pointers into argument vector */
8284
int geometry_bitmask;
8385
unsigned int geometry_columns; /* Value of --geometry */
8486
unsigned int geometry_rows;

0 commit comments

Comments
 (0)