Server.new_session
new_session(name => string, command => arrayref?, shell_command => string?, width => integer?, height => integer?, cwd => bytes?, environment => hashref?).
Source and package
-
Description#
Create a detached session and return its captured
LibTmux::Session. command is a literal argument vector; shell_command explicitly requests a shell and is mutually exclusive. Omitting both uses tmux's default command. cwd is path octets; environment supplies NAME/value pairs to the first process. Performs I/O. If creation succeeds but acquisition fails,"Creation" in LibTmux::Xretains the known generation-scoped creation receipt and cause.my $session = $server->new_session(name => 'application', command => ['/bin/cat']);Methods#
tmux command#
The tmux commands behind new_session.
display-message (daemon identity or target preflight) list-clients (after accepted creation) list-panes -a server scope, cmd_list_panes_server (after accepted creation) list-sessions (after accepted creation) list-windows -a server scope, cmd_list_windows_exec (after accepted creation) new-session tmux C API#
The C declarations in tmux that implement these commands.
cmd_display_message_entry cmd_display_message_exec cmd_list_clients_entry cmd_list_clients_exec cmd_list_panes_entry cmd_list_panes_server cmd_list_sessions_entry cmd_list_sessions_exec cmd_list_windows_entry cmd_list_windows_exec cmd_new_session_entry cmd_new_session_exec Each path starts at a function a command runs, which is degree 1. The degree counts steps from there along the path, and each step is a call or a reference: degree 2 is reached from that function, degree 3 from the next, and so on.
Create a session and its first pane
- 1
cmd_new_session_exec - calls → 2
spawn_window - calls → 3
spawn_pane - calls → 4
window_add_pane - calls → 5
window_pane_create
In other ports#
Create a session
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Ruby | Lib |
| Lua | libtmux |
| Erlang | tmux |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | server |
| Rust | server |
| Go | tmux |
| Java | io |
| Clojure | libtmux |
| Kotlin | io |
| Scala | io |
| C# | Lib |
| C++ | libtmux:: |
| Swift | Server |
| OCaml | Libtmux |
No equivalent is recorded in PowerShell, Julia, Elixir, Common Lisp or F#.