Documentation
¶
Index ¶
- Variables
- func AdaptiveTable(tableString string)
- func BuildTable(header []string, rows [][]string) string
- func CliPrettyPrint(header1, header2 string, map2write *map[string]string)
- func FitPanes(output_pane_x int)
- func Prompt(prompt string) string
- func ResetPaneLayout() error
- func TermSize() (width, height int, err error)
- func TmuxCurrentPane() (pane_id string)
- func TmuxCurrentWindow() (id string)
- func TmuxDeinitWindows()
- func TmuxDisplay(msg string) (res string)
- func TmuxInitWindows() (err error)
- func TmuxKillWindow(id string) (err error)
- func TmuxNewWindow(name, cmd string) error
- func TmuxSetOpt(index, opt string) (err error)
- func TmuxSetPaneTitle(title, pane_id string) error
- func TmuxSplit(hV, cmd string) error
- func TmuxSwitchWindow(window_id string) (res bool)
- func TmuxUpdatePane(pane *TmuxPane)
- func TmuxUpdatePanes()
- func TmuxWindowSize() (x, y int)
- func YesNo(prompt string) bool
- type TmuxPane
- func (pane *TmuxPane) ClearPane() (err error)
- func (pane *TmuxPane) KillPane() (err error)
- func (pane *TmuxPane) PaneDetails() (is_alive bool, title string, tty string, pid int, cmd string, width int, ...)
- func (pane *TmuxPane) Printf(clear bool, format string, a ...interface{})
- func (pane *TmuxPane) ResizePane(direction string, lines int) (err error)
- func (pane *TmuxPane) Respawn() (err error)
Constants ¶
This section is empty.
Variables ¶
var ( // TermWidth TermWidth int // TermHeight TermHeight int // home tmux window HomeWindow string // Console titled "Command" CommandPane *TmuxPane // Displays agent output, separated from logs OutputPane *TmuxPane // Displays agent list AgentListPane *TmuxPane // Displays bash shell for selected agent AgentShellPane *TmuxPane // SFTP shell for selected agent AgentSFTPPane *TmuxPane // Put all windows in this map TmuxPanes = make(map[string]*TmuxPane) // CAT use this cat to replace /bin/cat CAT = "emp3r0r-cat" )
Functions ¶
func AdaptiveTable ¶
func AdaptiveTable(tableString string)
AdaptiveTable is now a no-op since we don't need to resize for simple text
func BuildTable ¶
BuildTable creates a simple formatted list instead of a complex table
func CliPrettyPrint ¶
CliPrettyPrint prints two-column help info using simple formatting
func FitPanes ¶
func FitPanes(output_pane_x int)
FitPanes adjust width of panes to fit them in the terminal window triggered by agent output
func ResetPaneLayout ¶
func ResetPaneLayout() error
ResetPaneLayout resets all panes to their default layout proportions
func TmuxCurrentPane ¶
func TmuxCurrentPane() (pane_id string)
returns the index of current pane returns -1 when error occurs
func TmuxCurrentWindow ¶
func TmuxCurrentWindow() (id string)
All panes live in this tmux window, returns the unique ID of the window returns "" when error occurs
func TmuxDeinitWindows ¶
func TmuxDeinitWindows()
TmuxDeinitWindows close previously opened tmux windows
func TmuxDisplay ¶
func TmuxInitWindows ¶
func TmuxInitWindows() (err error)
TmuxInitWindows split current terminal into several windows/panes - command output window - current agent info
func TmuxKillWindow ¶
func TmuxNewWindow ¶
TmuxNewWindow run command in a new window
func TmuxSetOpt ¶
Set tmux option of current tmux window
func TmuxSetPaneTitle ¶
func TmuxSwitchWindow ¶
func TmuxUpdatePanes ¶
func TmuxUpdatePanes()
func TmuxWindowSize ¶
func TmuxWindowSize() (x, y int)
TmuxWindowSize size in chars, of the current tmux window/tab
Types ¶
type TmuxPane ¶
type TmuxPane struct {
Alive bool // indicates that pane is not dead
ID string // tmux pane unique ID
WindowID string // tmux window unique ID, indicates the window that the pane lives in
Title string // title of pane
Name string // intial title of pane, doesn't change even if pane is dead
TTY string // eg. /dev/pts/1, write to this file to get your message displayed on this pane
PID int // PID of the process running in tmux pane
Cmd string // cmdline of the process
Width int // width of pane, number of chars
Height int // height of pane, number of chars
}
TmuxPane a tmux window/pane that makes emp3r0r CC's interface
func TmuxNewPane ¶
func TmuxNewPane(title, hV string, target_pane_id string, size int, cmd string) (pane *TmuxPane, err error)
TmuxNewPane split tmux window, and run command in the new pane hV: horizontal or vertical split target_pane: target_pane tmux index, split this pane size: percentage, do not append %
func (*TmuxPane) PaneDetails ¶
func (pane *TmuxPane) PaneDetails() ( is_alive bool, title string, tty string, pid int, cmd string, width int, height int, )
PaneDetails Get details of a tmux pane
func (*TmuxPane) ResizePane ¶
ResizePane resize pane in x/y to number of lines