0

I want to be able to open a new terminal tab in the current terminal window and run a command in the new terminal tab from a script. Note that I don't want to open an entirely new terminal window, just a new tab.

Running the following opens a new tab as desired, but the echo command gets run in the terminal that executed the script as opposed to getting run in the new tab

#temp.sh
xdotool key ctrl+shift+t
echo 'hi'

If there's anyway to do this without using Tmux I'd greatly appreciate it!

1 Answer 1

1

Newest gnome-terminal versions support

gnome-terminal --tab [-e command ...]
3
  • Yes I'm aware of this but this isn't what I was looking for. This opens a new terminal window as opposed to a new tab in the current terminal Commented Jul 6, 2019 at 14:33
  • That's what it does in recent versions, e.g. in Ubuntu 19.04. Commented Jul 7, 2019 at 7:43
  • Ah I see. I'm still on Ubuntu 16.04 Commented Jul 7, 2019 at 15:45

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.