martanne / dvtm

dvtm brings the concept of tiling window management, popularized by X11-window managers like dwm to the console. As a console window manager it tries to make it easy to work with multiple console based programs.
MIT License
855 stars 106 forks source link

Behavior when cmd is passed #132

Open ikeji opened 2 years ago

ikeji commented 2 years ago

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 commented 2 years ago

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" } },
};