Core LibraryunreleasedAPI Reference

Choose documentation 2

latest

Current version

latest
English

Unreleased LibTmux has not been released. Its API may change during development. This site's structure and URLs may change too.

method libtmux-perl latest

Server.new_session

new_session(name => string, command => arrayref?, shell_command => string?, width => integer?, height => integer?, cwd => bytes?, environment => hashref?).

Source and package
Qualified name
LibTmux::Server::new_session
Module
LibTmux
Declared in
Server
Package
LibTmux
Source
packages/core/lib/LibTmux/Server.pm
Other languages
Erlang PowerShell Julia Elixir Haskell Common Lisp PythonRubyLuaTypeScriptRustGoJavaC#C++SwiftKotlinScalaOCaml F# Clojure
sub new_session($self, %args)

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::X retains the known generation-scoped creation receipt and cause.

my $session = $server->new_session(name => 'application', command => ['/bin/cat']);

Methods#

Parameters

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.

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. 1 cmd_new_session_exec
  2. calls → 2 spawn_window
  3. calls → 3 spawn_pane
  4. calls → 4 window_add_pane
  5. calls → 5 window_pane_create

In other ports#

Create a session

Esc

Type to search.

Reference previewOpen reference