Package org.jline.builtins
Class Tmux
- java.lang.Object
-
- org.jline.builtins.Tmux
-
public class Tmux extends java.lang.ObjectA terminal multiplexer similar to the 'tmux' Unix command.This class provides terminal multiplexing capabilities, allowing multiple virtual terminal sessions to be created, accessed, and controlled from a single terminal. Features include:
- Window and pane management
- Session persistence
- Split screen layouts
- Copy and paste functionality
- Status line display
- Command execution within panes
The implementation provides a subset of the functionality of the Unix 'tmux' command, adapted for JLine's terminal handling and pure Java implementation.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCMD_BINDstatic java.lang.StringCMD_BIND_KEYstatic java.lang.StringCMD_CLOCK_MODEstatic java.lang.StringCMD_COMMANDSstatic java.lang.StringCMD_DISPLAY_PANESstatic java.lang.StringCMD_DISPLAYPstatic java.lang.StringCMD_LIST_KEYSstatic java.lang.StringCMD_LIST_WINDOWSstatic java.lang.StringCMD_LSKstatic java.lang.StringCMD_LSWstatic java.lang.StringCMD_NEW_WINDOWstatic java.lang.StringCMD_NEWWstatic java.lang.StringCMD_NEXTstatic java.lang.StringCMD_NEXT_WINDOWstatic java.lang.StringCMD_PREVstatic java.lang.StringCMD_PREVIOUS_WINDOWstatic java.lang.StringCMD_RESIZE_PANEstatic java.lang.StringCMD_RESIZEPstatic java.lang.StringCMD_SELECT_PANEstatic java.lang.StringCMD_SELECTPstatic java.lang.StringCMD_SENDstatic java.lang.StringCMD_SEND_KEYSstatic java.lang.StringCMD_SEND_PREFIXstatic java.lang.StringCMD_SETstatic java.lang.StringCMD_SET_OPTIONstatic java.lang.StringCMD_SPLIT_WINDOWstatic java.lang.StringCMD_SPLITWstatic java.lang.StringCMD_UNBINDstatic java.lang.StringCMD_UNBIND_KEYstatic java.lang.StringOPT_PREFIX
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbindKey(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args)protected voidclockMode(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args)protected KeyMap<java.lang.Object>createEmptyKeyMap(java.lang.String prefix)protected KeyMap<java.lang.Object>createKeyMap(java.lang.String prefix)protected voiddisplayPanes(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args)voidexecute(java.io.PrintStream out, java.io.PrintStream err, java.lang.String command)voidexecute(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> command)protected voidlayoutResize()protected voidlistKeys(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args)protected voidlistWindows(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args)protected voidnewWindow(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args)protected voidnextWindow(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args)protected voidpreviousWindow(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args)protected voidredraw()Render all panes and the status line into the display and update the terminal screen.protected voidresizePane(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args)voidrun()protected voidselectPane(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args)protected voidsendKeys(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args)protected voidsendPrefix(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args)protected voidsetOption(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args)protected voidsplitWindow(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args)protected voidunbindKey(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args)
-
-
-
Field Detail
-
OPT_PREFIX
public static final java.lang.String OPT_PREFIX
- See Also:
- Constant Field Values
-
CMD_COMMANDS
public static final java.lang.String CMD_COMMANDS
- See Also:
- Constant Field Values
-
CMD_SEND_PREFIX
public static final java.lang.String CMD_SEND_PREFIX
- See Also:
- Constant Field Values
-
CMD_SPLIT_WINDOW
public static final java.lang.String CMD_SPLIT_WINDOW
- See Also:
- Constant Field Values
-
CMD_SPLITW
public static final java.lang.String CMD_SPLITW
- See Also:
- Constant Field Values
-
CMD_SELECT_PANE
public static final java.lang.String CMD_SELECT_PANE
- See Also:
- Constant Field Values
-
CMD_SELECTP
public static final java.lang.String CMD_SELECTP
- See Also:
- Constant Field Values
-
CMD_RESIZE_PANE
public static final java.lang.String CMD_RESIZE_PANE
- See Also:
- Constant Field Values
-
CMD_RESIZEP
public static final java.lang.String CMD_RESIZEP
- See Also:
- Constant Field Values
-
CMD_DISPLAY_PANES
public static final java.lang.String CMD_DISPLAY_PANES
- See Also:
- Constant Field Values
-
CMD_DISPLAYP
public static final java.lang.String CMD_DISPLAYP
- See Also:
- Constant Field Values
-
CMD_CLOCK_MODE
public static final java.lang.String CMD_CLOCK_MODE
- See Also:
- Constant Field Values
-
CMD_SET_OPTION
public static final java.lang.String CMD_SET_OPTION
- See Also:
- Constant Field Values
-
CMD_SET
public static final java.lang.String CMD_SET
- See Also:
- Constant Field Values
-
CMD_LIST_KEYS
public static final java.lang.String CMD_LIST_KEYS
- See Also:
- Constant Field Values
-
CMD_LSK
public static final java.lang.String CMD_LSK
- See Also:
- Constant Field Values
-
CMD_SEND_KEYS
public static final java.lang.String CMD_SEND_KEYS
- See Also:
- Constant Field Values
-
CMD_SEND
public static final java.lang.String CMD_SEND
- See Also:
- Constant Field Values
-
CMD_BIND_KEY
public static final java.lang.String CMD_BIND_KEY
- See Also:
- Constant Field Values
-
CMD_BIND
public static final java.lang.String CMD_BIND
- See Also:
- Constant Field Values
-
CMD_UNBIND_KEY
public static final java.lang.String CMD_UNBIND_KEY
- See Also:
- Constant Field Values
-
CMD_UNBIND
public static final java.lang.String CMD_UNBIND
- See Also:
- Constant Field Values
-
CMD_NEW_WINDOW
public static final java.lang.String CMD_NEW_WINDOW
- See Also:
- Constant Field Values
-
CMD_NEWW
public static final java.lang.String CMD_NEWW
- See Also:
- Constant Field Values
-
CMD_NEXT_WINDOW
public static final java.lang.String CMD_NEXT_WINDOW
- See Also:
- Constant Field Values
-
CMD_NEXT
public static final java.lang.String CMD_NEXT
- See Also:
- Constant Field Values
-
CMD_PREVIOUS_WINDOW
public static final java.lang.String CMD_PREVIOUS_WINDOW
- See Also:
- Constant Field Values
-
CMD_PREV
public static final java.lang.String CMD_PREV
- See Also:
- Constant Field Values
-
CMD_LIST_WINDOWS
public static final java.lang.String CMD_LIST_WINDOWS
- See Also:
- Constant Field Values
-
CMD_LSW
public static final java.lang.String CMD_LSW
- See Also:
- Constant Field Values
-
-
Method Detail
-
createKeyMap
protected KeyMap<java.lang.Object> createKeyMap(java.lang.String prefix)
-
createEmptyKeyMap
protected KeyMap<java.lang.Object> createEmptyKeyMap(java.lang.String prefix)
-
run
public void run() throws java.io.IOException- Throws:
java.io.IOException
-
execute
public void execute(java.io.PrintStream out, java.io.PrintStream err, java.lang.String command) throws java.lang.Exception- Throws:
java.lang.Exception
-
execute
public void execute(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> command) throws java.lang.Exception- Throws:
java.lang.Exception
-
listWindows
protected void listWindows(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args) throws java.lang.Exception- Throws:
java.lang.Exception
-
previousWindow
protected void previousWindow(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args) throws java.lang.Exception- Throws:
java.lang.Exception
-
nextWindow
protected void nextWindow(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args) throws java.lang.Exception- Throws:
java.lang.Exception
-
newWindow
protected void newWindow(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args) throws java.lang.Exception- Throws:
java.lang.Exception
-
setOption
protected void setOption(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args) throws java.lang.Exception- Throws:
java.lang.Exception
-
bindKey
protected void bindKey(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args) throws java.lang.Exception- Throws:
java.lang.Exception
-
unbindKey
protected void unbindKey(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args) throws java.lang.Exception- Throws:
java.lang.Exception
-
listKeys
protected void listKeys(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args) throws java.lang.Exception- Throws:
java.lang.Exception
-
sendKeys
protected void sendKeys(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args) throws java.lang.Exception- Throws:
java.lang.Exception
-
clockMode
protected void clockMode(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args) throws java.lang.Exception- Throws:
java.lang.Exception
-
displayPanes
protected void displayPanes(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args) throws java.lang.Exception- Throws:
java.lang.Exception
-
resizePane
protected void resizePane(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args) throws java.lang.Exception- Throws:
java.lang.Exception
-
selectPane
protected void selectPane(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args) throws java.lang.Exception- Throws:
java.lang.Exception
-
sendPrefix
protected void sendPrefix(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args) throws java.lang.Exception- Throws:
java.lang.Exception
-
splitWindow
protected void splitWindow(java.io.PrintStream out, java.io.PrintStream err, java.util.List<java.lang.String> args) throws java.lang.Exception- Throws:
java.lang.Exception
-
layoutResize
protected void layoutResize()
-
redraw
protected void redraw()
Render all panes and the status line into the display and update the terminal screen. Builds a composed screen from each pane's contents (or a clock string when a pane's clock mode is enabled), draws pane borders and optional pane identifiers, converts the composed buffer into attributed text lines, and submits them with the active cursor position to the Display for rendering.
-
-