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

Behavior when cmd is passed #132

Open
ikeji opened this issue Sep 6, 2022 · 1 comment
Open

Behavior when cmd is passed #132

ikeji opened this issue Sep 6, 2022 · 1 comment

Comments

@ikeji
Copy link

ikeji commented Sep 6, 2022

This is more like feature request or request of behavior change.

A. Here is the behavior when I didn't pass the cmd argument.

Steps:

  1. run 'dvtm' command.
  2. exit the shell by typing ^d.

Result:
The shell and dvtm is exit.

B. Here is current behavior when I run dvtm with cmd argument.

Steps:

  1. run 'dvtm python' command.
  2. exit the python by typing ^d.

My expected result:
Python and dvtm is exit.

Actual result:
The python is exit and dvtm starts another shell.
So, dvtm is not exit.

Does this behavior is expected?
Is there any way to skip open new shell?

Version

$ dvtm -v
dvtm-0.15+40.g311a8c0-1build1 © 2007-2016 Marc André Tanner

Use case

I want to open new window like:
xterm -e 'dvtm python'
And expected the window is closed when exist the python.

@rpmohn
Copy link
Contributor

rpmohn commented Sep 7, 2022

Check the actions[] array in your config.h file, which defines a set of actions that are executed when dvtm is started. It's probably set to this default value, which is to create a terminal window.

static Action actions[] = {
    { create, { NULL } },
};

To get the behavior you're looking for, you could remove the create action and always specify the python command when you run dvtm, or you could change that one create action to open python every time you start dvtm. I haven't messed around with the actions array much, something similar to this, but maybe not exactly this, should work if you want to do that.

static Action actions[] = {
    { create, { "python" } },
};

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

2 participants