Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create multiple tabs and run a command in each tab? #42

Open
kariotay opened this issue Dec 27, 2014 · 5 comments
Open

Create multiple tabs and run a command in each tab? #42

kariotay opened this issue Dec 27, 2014 · 5 comments

Comments

@kariotay
Copy link

A similar request was made here:

Start a number of preset tabs running a comand
#12

I'd like to know if it's possible to create a new tab,
and send a command to the tab. Any command --
ls, vim, emacs, etc.

For example, if you want to automate your setup
and not have to create the terminals by hand every time
you log in, you could create a perl extension using
tabbedex's functionality.

This is the basic idea:

$new_tab_one = tabs->create_new_tab('vim_tab', ...); # create a new 'tab' object
$new_tab_two = tabs->create_new_tab('emacs_tab', ...); # create a new 'tab' object

$cmd_a = ... # the command could be anything: ls, vim, a shell script, etc.
$cmd_b = ... # the command could be anything: ls, vim, a shell script, etc.

$new_tab_one->send_command($cmd_a); # send the command to the tab
$new_tab_two->send_command($cmd_b); # send the command to the tab

It would be useful to be able to do this, and it seems
like a feature that would be a great enhancement to
the functionality of tabbedex.

@mina86
Copy link

mina86 commented Aug 9, 2016

Check out https://github.com/mina86/urxvt-tabbedex/tree/experimental branch. It has an experimental feature which allows you to get custom commands in subsequent tabs. The feature to run multiple tabs at start-up is missing though.

@Lourens-Rich
Copy link

@mina86, why you don't merge this changes to master branch?

@mina86
Copy link

mina86 commented Jan 26, 2017

It’s only partial solution and more importantly I haven’t tested and thought it through just yet. In particular, while environment variable does the job, maybe there’s some better way of achieving the same result? Some more generic way for tab’s content to get information from tabbedex.

@mina86
Copy link

mina86 commented Apr 7, 2018

I’ve pushed a feature where new-tab-command resource accepts multiple values. This way one can specify different command for different tabs with:

URxvt.tabbedex.new-tab-command: \
    -e /usr/bin/irssi \n\
    -c echo /var/log/syslog:; exec tail -f /var/log/syslog \n\
    clear

The feature is available at https://github.com/mina86/urxvt-tabbedex/tree/experimental and with it, I’ll probably deprecate the $URXVT_TAB approach (even though it’s still present in the branch). Testing and feedback welcome!

@mina86
Copy link

mina86 commented Jul 22, 2018

I’ve ended up going with a bit different approach but one which lets you achieve result similar to what I’ve described above. See https://github.com/mina86/urxvt-tabbedex/blob/master/command-runner.sample which describes how different commands can be achieved.

There still is no way to start multiple tabs at once though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants