ii8 / havoc

minimal terminal emulator for wayland
Other
103 stars 17 forks source link

Run as a login shell #47

Open abrendtro opened 1 year ago

abrendtro commented 1 year ago

Could there be an option, as an alternative to program, to start as a login shell?

ii8 commented 1 year ago

I'm not sure what you mean, do you mean you want to run havoc bash -l but configured in havoc.cfg so it always starts like that? It should probably allow passing arguments to the shell in the config file, but what's your use case, why would you want to always have a login shell?

abrendtro commented 1 year ago

Passing arguments is the better solution in my case. The point is to run tmux new -A to attach to the running tmux server, or start it if it has stopped.

ii8 commented 1 year ago

I'm still not sure why you need a login shell for that. It doesn't do any command line parsing currently, perhaps it should. But for now there are a couple alternatives you can do, you can run havoc tmux new -A instead of just havoc, you could make an alias in your bashrc or wherever to save typing that each time alias tmuxterm='havoc tmux new -A'

Or you can make a little script, for example /usr/local/bin/start-tmux.sh:

#!/bin/sh
exec tmux new -A

Remember to make it executable: chmod +x /usr/local/bin/start-tmux.sh. And then put program=/usr/local/bin/start-tmux.sh in the havoc config.

Or you could add command line parsing to havoc.

abrendtro commented 1 year ago

This is essentially what I use, but I think parsing would make a lot more sense... Maybe I could open a pull request?

ii8 commented 1 year ago

Yes I would accept a pr for it, it would need to support quoting with ' and " and backslash escape.

abrendtro commented 1 year ago

I could also use a desktop file or keybinding, for example to run havoc tmux new -A