havoc icon indicating copy to clipboard operation
havoc copied to clipboard

Run as a login shell

Open ghost opened this issue 2 years ago • 6 comments

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

ghost avatar May 16 '23 19:05 ghost

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?

ii8 avatar May 16 '23 22:05 ii8

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.

abrendtro avatar May 17 '23 02:05 abrendtro

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.

ii8 avatar May 17 '23 09:05 ii8

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

abrendtro avatar May 17 '23 13:05 abrendtro

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

ii8 avatar May 17 '23 14:05 ii8

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

abrendtro avatar May 17 '23 20:05 abrendtro