Open new tab with same command given with --execute

Asked by Jonathan D Johnston on 2018-06-20

xfce4-terminal 0.6.3 (Xfce 4.12)

If I use the --execute command-line option, only the main tab uses the given command, e.g. -x /usr/bin/rlwrap /bin/dash . It would be nice if there was an option to use the --execute command with new tabs, as well. Currently, new tabs are always opened with $SHELL

I'm assuming this is more of an enhancement request than a bug report.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu xfce4-terminal Edit question
Assignee:
No assignee Edit question
Last query:
2018-06-23
Last reply:
2018-06-23

Add the option:

--tab

Does that help?

No, there already is a --tab option. How about --tab-command ? I would suggest something like --tab-command[=command], though that seems a bit verbose

If --tab-command is specified without a command, then it should default to the command given by --execute or --command

xfce4-terminal --tab --execute lsb_release -a

Does that work OK? In a new tab?

I suppose, but I would prefer to be able to Shift+Ctrl+T in a terminal and have it re-use the command specified on the command line. Maybe this shouldn't be the default behavior, which is why I was suggesting a new option. Either a command line option or a setting in ~/.config/xfce4/terminal/terminalrc .

Perhaps a specific use-case would help clarify what I'm suggesting.

My default shell is bash, so it makes sense that when I start Terminal or open a new tab (Shift+Ctrl+T) that bash is running. In essence it's a bash terminal.

However, I also want a dash terminal. The command line in my ~/.local/share/applications/dash-term.desktop is:
Exec=/usr/bin/xfce4-terminal -x /usr/bin/rlwrap /bin/dash
That works fine for the initial window. But, when I open a new tab (Shift+Ctrl+T), instead of dash, there's bash again.

It _would_ be possible to define a 1-line script, dtab, that does:
xfce4-terminal --tab -x /usr/bin/rlwrap /bin/dash &
I hadn't thought of that, so thanks, actionparsnip.

I still think it would be useful, for some uses, to be able to default new tabs to run the same command as the initial window. Please don't misunderstand, dash was simply an example. I could see doing something similar with Python or some other programming language which provides a REPL. For something like that, I would think the most natural action for Shift+Ctrl+T would be to run the --{command,execute} command in the new tab, rather than the user's default shell.

My apologies for being verbose, but there seemed to be some confusion about the enhancement I was suggesting.

If you add the command at the bottom of ~/.bashrc then it will run when the shell is launched

It's certainly not something I would want running every time ~/.bashrc ran!

Look, this was actually a fairly minor issue for me to begin with & we don't seem to be reaching any kind of consensus. I'm abandoning this thread. I can't count it as solved, but I don't want to spend any more time on it.

Thanks, anyway.

Can you help with this problem?

Provide an answer of your own, or ask Jonathan D Johnston for more information if necessary.

To post a message you must log in.