AgentCreate the session.
Result
{ "completed": true, "panes": [ { "paneId": "%1", "generation": "3f9a1c" } ], "sessionId": "$1", "generation": "3f9a1c", "ownership": "application"}Choose documentation 3
No matching documentation.
No matching versions.
Current version
latestNo matching languages.
Unreleased LibTmux has not been released. Its API may change during development. This site's structure and URLs may change too.
Julia-based tmux client
tmux client library for Julia. Control tmux, connect to and create servers, navigate sessions, windows, and panes, send keys, watch for changes via control mode, capture pane contents
Control tmux from Julia code unreleased Not published yet; install from source. Read more Core Library home →
using LibTmux
# A private server: a socket and an empty config of its own, so this# neither touches nor is changed by a tmux you already use.owned = open_server()server = owned.server
demo = new_session(server; name="demo")
# Lay out the session: name its window, split it, add a second window.editor = only(windows(snapshot(server, demo))).refrename_window(server, editor, "editor")left = only(filter(p -> p.active, panes(snapshot(server, editor)))).refright = split_window(server, left; direction=:right)logs = new_window(server, demo; name="logs")
# Type a command into the new pane and wait for what it prints.send_keys(server, right, "printf 'hello from %s\\n' tmux", "Enter")wait_for_text(server, right, "hello from tmux"; baseline=true)
# Move the focus an attached client sees: the pane, then the window.select_pane(server, right)select_window(server, WindowLinkRef(demo, logs, 1))
# Walk the objects: down from the server, then up from one pane.snap = snapshot(server)listed = sessions(snap)for each in listed println("session ", each.name) links = windowlinks(each) wins = [window(link) for link in links] for (link, win) in zip(links, wins) members = panes(win) ids = join((string(p.id) for p in members), " ") println(" window ", link.index, ":", win.name, ": ", ids) endendpane = snap[right]home = window(pane)owner = session(only(windowlinks(home)))println(string(pane.id), " is in window ", home.name, " of session ", owner.name)using LibTmux
try # A private server: a socket and an empty config of its own, so this # neither touches nor is changed by a tmux you already use. owned = open_server() server = owned.server
demo = new_session(server; name="demo")
# Lay out the session: name its window, split it, add a second window. editor = only(windows(snapshot(server, demo))).ref rename_window(server, editor, "editor") left = only(filter(p -> p.active, panes(snapshot(server, editor)))).ref right = split_window(server, left; direction=:right) logs = new_window(server, demo; name="logs")
# Type a command into the new pane and wait for what it prints. send_keys(server, right, "printf 'hello from %s\\n' tmux", "Enter") wait_for_text(server, right, "hello from tmux"; baseline=true)
# Move the focus an attached client sees: the pane, then the window. select_pane(server, right) select_window(server, WindowLinkRef(demo, logs, 1))
# Walk the objects: down from the server, then up from one pane. snap = snapshot(server) listed = sessions(snap) for each in listed println("session ", each.name) links = windowlinks(each) wins = [window(link) for link in links] for (link, win) in zip(links, wins) members = panes(win) ids = join((string(p.id) for p in members), " ") println(" window ", link.index, ":", win.name, ": ", ids) end end pane = snap[right] home = window(pane) owner = session(only(windowlinks(home))) println(string(pane.id), " is in window ", home.name, " of session ", owner.name)catch error println(stderr, "tmux quickstart failed: ", sprint(showerror, error)) rethrow()endusing LibTmux
# A private server: a socket and an empty config of its own, so this# neither touches nor is changed by a tmux you already use.with_server() do server demo = new_session(server; name="demo")
# Lay out the session: name its window, split it, add a second window. editor = only(windows(snapshot(server, demo))).ref rename_window(server, editor, "editor") left = only(filter(p -> p.active, panes(snapshot(server, editor)))).ref right = split_window(server, left; direction=:right) logs = new_window(server, demo; name="logs")
# Type a command into the new pane and wait for what it prints. send_keys(server, right, "printf 'hello from %s\\n' tmux", "Enter") wait_for_text(server, right, "hello from tmux"; baseline=true)
# Move the focus an attached client sees: the pane, then the window. select_pane(server, right) select_window(server, WindowLinkRef(demo, logs, 1))
# Walk the objects: down from the server, then up from one pane. snap = snapshot(server) listed = sessions(snap) for each in listed println("session ", each.name) links = windowlinks(each) wins = [window(link) for link in links] for (link, win) in zip(links, wins) members = panes(win) ids = join((string(p.id) for p in members), " ") println(" window ", link.index, ":", win.name, ": ", ids) end end pane = snap[right] home = window(pane) owner = session(only(windowlinks(home))) println(string(pane.id), " is in window ", home.name, " of session ", owner.name)endusing LibTmux
try # A private server: a socket and an empty config of its own, so this # neither touches nor is changed by a tmux you already use. with_server() do server demo = new_session(server; name="demo")
# Lay out the session: name its window, split it, add a second window. editor = only(windows(snapshot(server, demo))).ref rename_window(server, editor, "editor") left = only(filter(p -> p.active, panes(snapshot(server, editor)))).ref right = split_window(server, left; direction=:right) logs = new_window(server, demo; name="logs")
# Type a command into the new pane and wait for what it prints. send_keys(server, right, "printf 'hello from %s\\n' tmux", "Enter") wait_for_text(server, right, "hello from tmux"; baseline=true)
# Move the focus an attached client sees: the pane, then the window. select_pane(server, right) select_window(server, WindowLinkRef(demo, logs, 1))
# Walk the objects: down from the server, then up from one pane. snap = snapshot(server) listed = sessions(snap) for each in listed println("session ", each.name) links = windowlinks(each) wins = [window(link) for link in links] for (link, win) in zip(links, wins) members = panes(win) ids = join((string(p.id) for p in members), " ") println(" window ", link.index, ":", win.name, ": ", ids) end end pane = snap[right] home = window(pane) owner = session(only(windowlinks(home))) println(string(pane.id), " is in window ", home.name, " of session ", owner.name) endcatch error println(stderr, "tmux quickstart failed: ", sprint(showerror, error)) rethrow()endtmux before the first call: no server is running.
tmux after with_server: no server is running; the call sent no command.
tmux after new_session: added session demo.
tmux after snapshot: unchanged.
tmux after rename_window: renamed window 0:sh to 0:editor.
tmux after snapshot: unchanged.
tmux after split_window: added pane %1 to window 0:editor.
tmux after new_window: added window 1:logs.
tmux after send_keys: sent keys to pane %1.
$ printf 'hello from %s\n' tmux hello from tmux $
tmux after wait_for_text: read pane %1.
$ printf 'hello from %s\n' tmux hello from tmux $
tmux after select_pane: selected pane %1 in window 0:editor.
$ printf 'hello from %s\n' tmux hello from tmux $
tmux after select_window: selected window 1:logs.
$ printf 'hello from %s\n' tmux hello from tmux $
tmux after snapshot: unchanged.
$ printf 'hello from %s\n' tmux hello from tmux $
tmux after sessions: unchanged, the call sent no command.
$ printf 'hello from %s\n' tmux hello from tmux $
tmux after windowlinks: unchanged, the call sent no command.
$ printf 'hello from %s\n' tmux hello from tmux $
tmux after window: unchanged, the call sent no command.
$ printf 'hello from %s\n' tmux hello from tmux $
tmux after panes: unchanged, the call sent no command.
$ printf 'hello from %s\n' tmux hello from tmux $
tmux after panes: unchanged, the call sent no command.
$ printf 'hello from %s\n' tmux hello from tmux $
tmux after Snapshot[PaneRef]: unchanged, the call sent no command.
$ printf 'hello from %s\n' tmux hello from tmux $
tmux after window: unchanged, the call sent no command.
$ printf 'hello from %s\n' tmux hello from tmux $
tmux after session: unchanged, the call sent no command.
Before the first call
No tmux server is running yet.
with_server returned Server
{ "socketPath": "/tmp/libtmux-julia-AbC123/s", "tmux": "tmux"}The call sent no tmux command.
new_session returned SessionRef
{ "id": "$0"}run-shell -C libtmux-version-465045ed74ec4dd197fc1cc5f73f0fef#{version} unknown command: libtmux-version-465045ed74ec4dd197fc1cc5f73f0fef3.8a if-shell -F #{==:#{version},3.8a} '' libtmux-version-cbb9aebed37b4e658e50ab5a318dbcf7 ; new-session -d -P -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:start_time} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:socket_path} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_id}' -s demo -- 3441885 1793890630 /tmp/libtmux-julia-AbC123/s \d0 { "window": "@0"}if-shell -F #{==:#{version},3.8a} '' libtmux-version-9d45de1df1384f03a09737c2d38fb790 ; display-message -p '#{s|^.*$|A\\B C
D|;s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version}' A\\B\tC\nD if-shell -F #{==:#{version},3.8a} '' libtmux-version-f02f9c82a2f94cb29d454113d03ad31f ; display-message -p -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:start_time} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:socket_path}' 3441885 1793890630 3.8a /tmp/libtmux-julia-AbC123/s if-shell -F #{==:#{version},3.8a} '' libtmux-version-4ef6f1f9d0fe438ab48542ed2db0ff2c ; list-sessions -f #{==:#{session_id},$0} -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_name} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_attached} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_created} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\… \d0 demo 0 1793890631 1793890631 if-shell -F #{==:#{version},3.8a} '' libtmux-version-285052c50b2945c582c8f526993ab50d ; list-windows -t $0 -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_name} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_width} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_height} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_id} #{s|\\|\\\\|;s… @0 sh 80 24 \d0 0 1 {"V":2,"L":{"t":"p","w":80,"h":24,"x":0,"y":0,"a":true,"i":0,"I":"%0"}} {"V":2,"L":{"t":"p","w":80,"h":24,"x":0,"y":0,"a":true,"i":0,"I":"%0"}} 0 1793890631 if-shell -F #{==:#{version},3.8a} '' libtmux-version-32fed395ac7f454fbf27d0fa8ef8d4c9 ; list-panes -s -t $0 -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_index} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_active} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_dead} #{s|\\|\\\\|;s|[$]|\\d… %0 @0 0 1 0 80 24 sh /tmp/marked host 3442058 /dev/pts/14 0 2000 2 0 if-shell -F #{==:#{version},3.8a} '' libtmux-version-b8ee171b0f5f47c3b995c427e672232a ; list-sessions -f #{==:#{session_id},$0} -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_name} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_attached} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_created} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\… \d0 demo 0 1793890631 1793890631 if-shell -F #{==:#{version},3.8a} '' libtmux-version-0b01827cc4e04752a4330e319138995f ; list-windows -t $0 -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_name} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_width} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_height} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_id} #{s|\\|\\\\|;s… @0 sh 80 24 \d0 0 1 {"V":2,"L":{"t":"p","w":80,"h":24,"x":0,"y":0,"a":true,"i":0,"I":"%0"}} {"V":2,"L":{"t":"p","w":80,"h":24,"x":0,"y":0,"a":true,"i":0,"I":"%0"}} 0 1793890631 if-shell -F #{==:#{version},3.8a} '' libtmux-version-d300136b9b8e4698b31e42d3b48d8f47 ; list-panes -s -t $0 -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_index} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_active} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_dead} #{s|\\|\\\\|;s|[$]|\\d… %0 @0 0 1 0 80 24 sh /tmp/marked host 3442058 /dev/pts/14 0 2000 2 0 if-shell -F #{==:#{version},3.8a} '' libtmux-version-5f1aa1c0684c4e81b42b09c7c5ac0983 ; display-message -p -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:start_time} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:socket_path}' 3441885 1793890630 3.8a /tmp/libtmux-julia-AbC123/s rename_window returned CommandResult
{ "exitcode": 0}if-shell -F #{==:#{version},3.8a} '' libtmux-version-9ccb18b99b7343029ffdd702e708e462 ; display-message -p '#{s|^.*$|A\\B C
D|;s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version}' A\\B\tC\nD if-shell -F #{==:#{version},3.8a} '' libtmux-version-d1c5e54b9ab549239c91f4412cf0d0a6 ; display-message -p -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:start_time} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:socket_path}' 3441885 1793890630 3.8a /tmp/libtmux-julia-AbC123/s if-shell -F #{==:#{version},3.8a} '' libtmux-version-81243a57913144adbcf3a4b49ead44fe ; rename-window -t @0 -- editor no output { "pane": "%0"}if-shell -F #{==:#{version},3.8a} '' libtmux-version-ef2cb5112cd5497a8543c4503cd55422 ; display-message -p '#{s|^.*$|A\\B C
D|;s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version}' A\\B\tC\nD if-shell -F #{==:#{version},3.8a} '' libtmux-version-b929b2eddc3949d682c8f048435a06e5 ; display-message -p -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:start_time} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:socket_path}' 3441885 1793890630 3.8a /tmp/libtmux-julia-AbC123/s if-shell -F #{==:#{version},3.8a} '' libtmux-version-0ba9b16d373043079d539d143d214a87 ; list-windows -a -f #{==:#{window_id},@0} -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_name} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_width} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_height} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:sess… @0 editor 80 24 \d0 0 1 {"V":2,"L":{"t":"p","w":80,"h":24,"x":0,"y":0,"a":true,"i":0,"I":"%0"}} {"V":2,"L":{"t":"p","w":80,"h":24,"x":0,"y":0,"a":true,"i":0,"I":"%0"}} 0 1793890631 if-shell -F #{==:#{version},3.8a} '' libtmux-version-79b0437f39ce45b3a39d37cbf192e3c0 ; list-sessions -f #{m/r:^[$](0)$,#{session_id}} -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_name} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_attached} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_created} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|… \d0 demo 0 1793890631 1793890631 if-shell -F #{==:#{version},3.8a} '' libtmux-version-61a6eba6063a4a399eeaa4575d8a8684 ; list-panes -t @0 -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_index} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_active} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_dead} #{s|\\|\\\\|;s|[$]|\\d|;s… %0 @0 0 1 0 80 24 sh /tmp/marked host 3442058 /dev/pts/14 0 2000 2 0 if-shell -F #{==:#{version},3.8a} '' libtmux-version-391b290769654a2cbd0f88ae1d722d55 ; list-windows -a -f #{==:#{window_id},@0} -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_name} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_width} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_height} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:sess… @0 editor 80 24 \d0 0 1 {"V":2,"L":{"t":"p","w":80,"h":24,"x":0,"y":0,"a":true,"i":0,"I":"%0"}} {"V":2,"L":{"t":"p","w":80,"h":24,"x":0,"y":0,"a":true,"i":0,"I":"%0"}} 0 1793890631 if-shell -F #{==:#{version},3.8a} '' libtmux-version-81c7dbab83fa4225985cf43b705d9959 ; list-sessions -f #{m/r:^[$](0)$,#{session_id}} -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_name} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_attached} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_created} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|… \d0 demo 0 1793890631 1793890631 if-shell -F #{==:#{version},3.8a} '' libtmux-version-76dfabd48f4442a5a1894ef4ed3c871e ; list-panes -t @0 -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_index} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_active} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_dead} #{s|\\|\\\\|;s|[$]|\\d|;s… %0 @0 0 1 0 80 24 sh /tmp/marked host 3442058 /dev/pts/14 0 2000 2 0 if-shell -F #{==:#{version},3.8a} '' libtmux-version-e6147f39a505402ab58ccf0162c354b2 ; display-message -p -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:start_time} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:socket_path}' 3441885 1793890630 3.8a /tmp/libtmux-julia-AbC123/s split_window returned PaneRef
{ "pane": "%1"}if-shell -F #{==:#{version},3.8a} '' libtmux-version-0d9bfd316c33447c9b0d15b240c6765b ; display-message -p '#{s|^.*$|A\\B C
D|;s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version}' A\\B\tC\nD if-shell -F #{==:#{version},3.8a} '' libtmux-version-8516fe805ffb4faebfa0bd930afece46 ; display-message -p -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:start_time} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:socket_path}' 3441885 1793890630 3.8a /tmp/libtmux-julia-AbC123/s if-shell -F #{==:#{version},3.8a} '' libtmux-version-d71a02c9acb24bfdbc78bee1ab63c1ac ; split-window -d -P -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:start_time} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:socket_path} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_id}' -t %0 -h -- 3441885 1793890630 /tmp/libtmux-julia-AbC123/s %1 new_window returned WindowRef
{ "window": "@1"}if-shell -F #{==:#{version},3.8a} '' libtmux-version-10884d55952b4848b5840b1e94ebdca5 ; display-message -p '#{s|^.*$|A\\B C
D|;s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version}' A\\B\tC\nD if-shell -F #{==:#{version},3.8a} '' libtmux-version-7371001bb5614d35b330b81d59055823 ; display-message -p -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:start_time} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:socket_path}' 3441885 1793890630 3.8a /tmp/libtmux-julia-AbC123/s if-shell -F #{==:#{version},3.8a} '' libtmux-version-2452f1d108494e429eb29f6b0b1bbf6d ; new-window -d -P -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:start_time} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:socket_path} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_id}' -t $0: -n logs -- 3441885 1793890630 /tmp/libtmux-julia-AbC123/s @1 send_keys returned CommandResult
{ "exitcode": 0}if-shell -F #{==:#{version},3.8a} '' libtmux-version-55866a72153346748e35d00434521e22 ; display-message -p '#{s|^.*$|A\\B C
D|;s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version}' A\\B\tC\nD if-shell -F #{==:#{version},3.8a} '' libtmux-version-8f06ee6323ed4354ae3a26910219ec11 ; display-message -p -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:start_time} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:socket_path}' 3441885 1793890630 3.8a /tmp/libtmux-julia-AbC123/s if-shell -F #{==:#{version},3.8a} '' libtmux-version-79d8597862c247eeab577a2975ae215c ; send-keys -t %1 -- 'printf '\''hello from %s\n'\'' tmux' Enter no output wait_for_text returned ScreenWaitResult
{ "source": "baseline"}if-shell -F #{==:#{version},3.8a} '' libtmux-version-cafd9f55e97d41218c19365c3573d15f ; capture-pane -p -J -t %1 ; run-shell -C -t %1 libtmux-screen-d833d97117db4003#{q:pane_id}-#{q:pane_dead}-#{q:alternate_on}-#{q:pid}-#{q:start_time}| $ printf 'hello from %s\n' tmux
hello from tmux
$ select_pane returned CommandResult
{ "exitcode": 0}if-shell -F #{==:#{version},3.8a} '' libtmux-version-c4806e1305e44df9ade40a59080ea8e1 ; display-message -p '#{s|^.*$|A\\B C
D|;s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version}' A\\B\tC\nD if-shell -F #{==:#{version},3.8a} '' libtmux-version-59fbea4cdc174c44acd0b6488eae1d5b ; display-message -p -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:start_time} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:socket_path}' 3441885 1793890630 3.8a /tmp/libtmux-julia-AbC123/s if-shell -F #{==:#{version},3.8a} '' libtmux-version-4caff35b1e92492684f74521b437f0bf ; select-pane -t %1 no output select_window returned CommandResult
{ "exitcode": 0}if-shell -F #{==:#{version},3.8a} '' libtmux-version-05de955e80694346b7abfde866439e70 ; display-message -p '#{s|^.*$|A\\B C
D|;s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version}' A\\B\tC\nD if-shell -F #{==:#{version},3.8a} '' libtmux-version-83272f07bb98465eb06ece31564abdb5 ; display-message -p -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:start_time} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:socket_path}' 3441885 1793890630 3.8a /tmp/libtmux-julia-AbC123/s if-shell -F #{==:#{version},3.8a} '' libtmux-version-6325ad74e74043ddb55f078a2ea60e22 ; list-windows -t $0 -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_index} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_id}' 0 @0
1 @1 if-shell -F #{==:#{version},3.8a} '' libtmux-version-23fceeabb69d4ab69c18b486fa45dc7b ; select-window -t $0:1 no output { "sessions": 1, "panes": 3, "windows": 2}if-shell -F #{==:#{version},3.8a} '' libtmux-version-0dadc8c62ce34043a1aa2fe094ebaf06 ; display-message -p '#{s|^.*$|A\\B C
D|;s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version}' A\\B\tC\nD if-shell -F #{==:#{version},3.8a} '' libtmux-version-f1f9e9ccb6574b13ad9993b0ad2fb767 ; display-message -p -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:start_time} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:socket_path}' 3441885 1793890630 3.8a /tmp/libtmux-julia-AbC123/s if-shell -F #{==:#{version},3.8a} '' libtmux-version-2d597e77a4d946e3a4109aab72e102a1 ; list-sessions -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_name} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_attached} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_created} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_activity} #{s|\… \d0 demo 0 1793890631 1793890631 if-shell -F #{==:#{version},3.8a} '' libtmux-version-f7f1308aa46940df9eb9989d59978085 ; list-windows -a -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_name} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_width} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_height} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_id} #{s|\\|\\\\|;s|[$… @0 editor 80 24 \d0 0 0 {"V":2,"L":{"t":"h","w":80,"h":24,"x":0,"y":0,"c":[{"t":"p","w":40,"h":24,"x":0,"y":0,"l":0,"i":0,"I":"%0"},{"t":"p","w":39,"h":24,"x":41,"y":0,"a":true,"i":1,"I":"%1"}]}} {"V":2,"L":{"t":"h","w":80,"h":24,"x":0,"y":0,"c":[{"t":"p","w":40,"h":24,"x":0,"y":0,"l":0,"i":0,"I":"%0"},{"t":"p","w":39,"h":24,"x":41,"y":0,"a":true,"i":1,"I":"%1"}]}} 0 1793890636
@1 logs 80 24 \d0 1… if-shell -F #{==:#{version},3.8a} '' libtmux-version-f4f85bf687204eb99181c354c354f960 ; list-panes -a -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_index} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_active} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_dead} #{s|\\|\\\\|;s|[$]|\\d|;s| |… %0 @0 0 0 0 40 24 sh /tmp/marked host 3442058 /dev/pts/14 0 2000 2 0
%1 @0 1 1 0 39 24 sh /tmp/marked host 3442541 /dev/pts/16 0 2000 2 2
%2 @1 0 1 0 80 24 sh /tmp/marked host 3442666 /dev/pts/17 0 2000 2 0 if-shell -F #{==:#{version},3.8a} '' libtmux-version-fe2889d3c6c548b6a01a3d647626fd35 ; list-clients -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:client_name} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:client_pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:client_created} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:client_activity}' no output if-shell -F #{==:#{version},3.8a} '' libtmux-version-4815c9935096410bb1fd5dc11e584a7b ; list-sessions -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_name} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_attached} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_created} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_activity} #{s|\… \d0 demo 0 1793890631 1793890631 if-shell -F #{==:#{version},3.8a} '' libtmux-version-e988d0c6698343428e33d7f2b6405c13 ; list-windows -a -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_name} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_width} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_height} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_id} #{s|\\|\\\\|;s|[$… @0 editor 80 24 \d0 0 0 {"V":2,"L":{"t":"h","w":80,"h":24,"x":0,"y":0,"c":[{"t":"p","w":40,"h":24,"x":0,"y":0,"l":0,"i":0,"I":"%0"},{"t":"p","w":39,"h":24,"x":41,"y":0,"a":true,"i":1,"I":"%1"}]}} {"V":2,"L":{"t":"h","w":80,"h":24,"x":0,"y":0,"c":[{"t":"p","w":40,"h":24,"x":0,"y":0,"l":0,"i":0,"I":"%0"},{"t":"p","w":39,"h":24,"x":41,"y":0,"a":true,"i":1,"I":"%1"}]}} 0 1793890636
@1 logs 80 24 \d0 1… if-shell -F #{==:#{version},3.8a} '' libtmux-version-7d60def5f8aa4b21b562502025462822 ; list-panes -a -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:window_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_index} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_active} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pane_dead} #{s|\\|\\\\|;s|[$]|\\d|;s| |… %0 @0 0 0 0 40 24 sh /tmp/marked host 3442058 /dev/pts/14 0 2000 2 0
%1 @0 1 1 0 39 24 sh /tmp/marked host 3442541 /dev/pts/16 0 2000 2 2
%2 @1 0 1 0 80 24 sh /tmp/marked host 3442666 /dev/pts/17 0 2000 2 0 if-shell -F #{==:#{version},3.8a} '' libtmux-version-0bf9111f9b2a434987384cebcf81f5fa ; list-clients -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:client_name} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:client_pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:client_created} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:session_id} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:client_activity}' no output if-shell -F #{==:#{version},3.8a} '' libtmux-version-e8d63025cf4f442a97a847cff9a36933 ; display-message -p -F '#{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:pid} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:start_time} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:version} #{s|\\|\\\\|;s|[$]|\\d|;s| |\\t|;s|
|\\n|:socket_path}' 3441885 1793890630 3.8a /tmp/libtmux-julia-AbC123/s sessions returned Selection{SessionSnapshot}
{ "sessions": [ "$0" ]}The call sent no tmux command.
windowlinks returned Selection{WindowLink}
{ "windows": [ "@0", "@1" ]}The call sent no tmux command.
window returned Vector{WindowSnapshot}
{ "windows": [ "@0", "@1" ]}The call sent no tmux command.
panes returned Selection{PaneSnapshot}
{ "panes": [ "%0", "%1" ]}The call sent no tmux command.
panes returned Selection{PaneSnapshot}
{ "panes": [ "%2" ]}The call sent no tmux command.
Snapshot[PaneRef] returned PaneSnapshot
{ "id": "%1"}The call sent no tmux command.
window returned WindowSnapshot
{ "name": "editor", "id": "@0"}The call sent no tmux command.
session returned SessionSnapshot
{ "name": "demo", "id": "$0"}The call sent no tmux command.
Julia 1.13.0, Git, POSIX shell and tmux on Linux.
Save the program above as quickstart.jl in a new directory, along with the files below.
Cleanup is omitted; the private tmux server and its temporary files may remain. Select Cleanup to remove them when the program finishes. The program stops its private tmux server and removes any temporary files it created when it finishes. Error handling adds diagnostics; every version checks required results and deadlines.
git init -q sourcegit -C source fetch -q --depth=1 \ https://github.com/libtmux/libtmux-julia.git \ f2b0fb8e3c4d2e951579e9620cb3396dd5cdc59fgit -C source checkout -q --detach FETCH_HEADunset TMUX TMUX_PANEexport ENV=/dev/null BASH_ENV=/dev/null SHELL=/bin/shjulia --startup-file=no --project=source quickstart.jlsession demo window 0:editor: %0 %1 window 1:logs: %2%1 is in window editor of session demoLibTmuxusing Pkg
Pkg.activate(".")
Pkg.add(PackageSpec(
url="https://github.com/libtmux/libtmux-julia.git",
rev="ad641d77d03750c6c0e04b623cf267c86c0d0974",
))using Pkg
Pkg.add(PackageSpec(url="https://github.com/libtmux/libtmux-julia.git", rev="master"))Run in Julia with tmux on PATH. The package is not registered in General, so this installs from Git; Manifest.toml records the package tree hash.
Pins the tagged source; the registry release is the default.
Give an assistant tmux tools concept Working example; may change without notice. Read more MCP home →
tmux before the first call.
tmux after create_session.
tmux after send_keys.
tmux after list_panes: unchanged, the call only reads.
tmux after send_keys_and_wait.
tmux after send_keys_and_wait.
tmux after teardown_session.
Create a tmux session called checks, split its window into two panes, run pytest -q in one and show checks.log in the other, show me the results, then remove the session.
AgentCreate the session.
{ "completed": true, "panes": [ { "paneId": "%1", "generation": "3f9a1c" } ], "sessionId": "$1", "generation": "3f9a1c", "ownership": "application"}AgentThis server has no split tool, so split from inside the pane the create result returned (%1) with tmux itself.
send_keys Execute {"target":{"paneId":"%1","generation":"3f9a1c"},"keys":["tmux split-window -h sh","Enter"]} { "completed": true, "generationGuarantee": "best_effort", "target": { "paneId": "%1", "generation": "3f9a1c" }}AgentList the panes of the session the create result returned ($1); each carries its position and size.
{ "coverage": "session_scope", "contextsCoverage": "selected_session", "terminalContent": "data", "nextOffset": null, "pagination": "verified_discovery_facets", "generationGuarantee": "best_effort", "panes": [ { "contextsTruncated": false, "width": 40, "caller": false, "contexts": [ { "sessionName": "checks", "windowName": "sh", "windowIndex": 0, "sessionId": "$1", "windowId": "@1" } ], "height": 24, "fieldsTruncated": false, "title": "host", "active": false, "dead": false, "command": "sh", "target": { "paneId": "%1", "generation": "3f9a1c" } }, { "contextsTruncated": false, "width": 39, "caller": false, "contexts": [ { "sessionName": "checks", "windowName": "sh", "windowIndex": 0, "sessionId": "$1", "windowId": "@1" } ], "height": 24, "fieldsTruncated": false, "title": "host", "active": true, "dead": false, "command": "sh", "target": { "paneId": "%2", "generation": "3f9a1c" } } ], "total": 2, "nextPageToken": null, "truncated": false}AgentRun the tests in the pane the create result returned (%1) and wait for the summary.
send_keys_and_wait Execute {"target":{"paneId":"%1","generation":"3f9a1c"},"keys":["pytest -q","Enter"],"text":"2 passed"} { "matched": true, "source": "output", "terminalContent": "data", "evidence": "literal_text", "continuity": "stream", "text": "2 passed", "generationGuarantee": "best_effort", "keysSent": true, "target": { "paneId": "%1", "generation": "3f9a1c" }}AgentShow the log in the new pane the list returned (%2) and wait for its last line.
send_keys_and_wait Execute {"target":{"paneId":"%2","generation":"3f9a1c"},"keys":["cat checks.log","Enter"],"text":"checks finished"} { "matched": true, "source": "output", "terminalContent": "data", "evidence": "literal_text", "continuity": "stream", "text": "checks finished", "generationGuarantee": "best_effort", "keysSent": true, "target": { "paneId": "%2", "generation": "3f9a1c" }}AgentRemove the session by the id the create result returned ($1).
{ "completed": true, "sessionId": "$1", "generation": "3f9a1c"}pytest printed 2 passed and checks.log ends with checks finished. I removed the checks session.
LibTmuxMCPChoose your client and configuration scope, then run the command or paste the configuration.
$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "ad641d77d03750c6c0e04b623cf267c86c0d0974"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ claude mcp add tmux \
-- /absolute/path/to/project/bin/libtmux-mcp \
--socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "ad641d77d03750c6c0e04b623cf267c86c0d0974"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ claude mcp add tmux \
--scope user \
-- /absolute/path/to/project/bin/libtmux-mcp \
--socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "ad641d77d03750c6c0e04b623cf267c86c0d0974"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ claude mcp add tmux \
--scope project \
-- /absolute/path/to/project/bin/libtmux-mcp \
--socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "ad641d77d03750c6c0e04b623cf267c86c0d0974"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'{
"mcpServers": {
"tmux": {
"command": "/absolute/path/to/project/bin/libtmux-mcp",
"args": ["--socket", "/absolute/path/to/tmux.sock"]
}
}
}$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "ad641d77d03750c6c0e04b623cf267c86c0d0974"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ codex mcp add tmux \
-- /absolute/path/to/project/bin/libtmux-mcp \
--socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "ad641d77d03750c6c0e04b623cf267c86c0d0974"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'[mcp_servers.tmux]
command = "/absolute/path/to/project/bin/libtmux-mcp"
args = ["--socket", "/absolute/path/to/tmux.sock"]$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "ad641d77d03750c6c0e04b623cf267c86c0d0974"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ gemini mcp add \
--scope user \
tmux /absolute/path/to/project/bin/libtmux-mcp \
-- --socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "ad641d77d03750c6c0e04b623cf267c86c0d0974"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ gemini mcp add \
--scope project \
tmux /absolute/path/to/project/bin/libtmux-mcp \
-- --socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "ad641d77d03750c6c0e04b623cf267c86c0d0974"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'{
"mcpServers": {
"tmux": {
"command": "/absolute/path/to/project/bin/libtmux-mcp",
"args": ["--socket", "/absolute/path/to/tmux.sock"]
}
}
}$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "ad641d77d03750c6c0e04b623cf267c86c0d0974"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'{
"mcpServers": {
"tmux": {
"command": "/absolute/path/to/project/bin/libtmux-mcp",
"args": ["--socket", "/absolute/path/to/tmux.sock"]
}
}
}$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "ad641d77d03750c6c0e04b623cf267c86c0d0974"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ grok mcp add \
--scope user \
tmux \
-- /absolute/path/to/project/bin/libtmux-mcp \
--socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "ad641d77d03750c6c0e04b623cf267c86c0d0974"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ grok mcp add \
--scope project \
tmux \
-- /absolute/path/to/project/bin/libtmux-mcp \
--socket /absolute/path/to/tmux.sock$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "ad641d77d03750c6c0e04b623cf267c86c0d0974"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'{
"mcpServers": {
"tmux": {
"command": "/absolute/path/to/project/bin/libtmux-mcp",
"args": ["--socket", "/absolute/path/to/tmux.sock"]
}
}
}$ julia --startup-file=no -e '
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "ad641d77d03750c6c0e04b623cf267c86c0d0974"
Pkg.add([
Pkg.PackageSpec(url=repo, rev=ref),
Pkg.PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxMCP")])
using LibTmuxMCP
println(LibTmuxMCP.install_cli("bin"))'$ opencode mcp add tmux \
-- /absolute/path/to/project/bin/libtmux-mcp \
--socket /absolute/path/to/tmux.sockWrites ~/.claude.json (this project).
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes ~/.claude.json (all projects).
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes .mcp.json (in repo, version-controlled).
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes ~/.codex/config.toml.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Codex's CLI doesn't support project scope yet — paste this into .codex/config.toml at the repo root.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes ~/.gemini/settings.json.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes .gemini/settings.json (in repo).
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes ~/.grok/config.toml.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes ./.grok/config.toml (in repo).
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Writes ~/.config/opencode/opencode.jsonc.
Run the setup in a consumer project directory. Replace the launcher and socket paths with absolute paths on your machine. The server borrows an existing tmux daemon. Configure tool permissions as described in the MCP server guide.
Load a workspace file concept Working example; may change without notice. Read more Workspace Manager home →
A window of three panes.
session_name: 3-paneswindows: - window_name: dev window layout: main-vertical shell_command_before: - cd ~/ panes: - shell_command: - cd /var/log - ls -al | grep \.log - echo hello - echo hello{ "session_name": "3-panes", "windows": [ { "window_name": "dev window", "layout": "main-vertical", "shell_command_before": [ "cd ~/" ], "panes": [ { "shell_command": [ "cd /var/log", "ls -al | grep \\.log" ] }, "echo hello", "echo hello" ] } ]}
Workspace file: packages/LibTmuxWorkspace/test/fixtures/tmuxp/3-pane.yaml.
Tested by tmuxp example catalog
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
A pane can be one command written as a string, and a command list can be one string.
session_name: shorthandswindows: - window_name: long form panes: - shell_command: - echo 'did you know' - echo 'you can inline' - shell_command: echo 'single commands' - echo 'for panes'{ "session_name": "shorthands", "windows": [ { "window_name": "long form", "panes": [ { "shell_command": [ "echo 'did you know'", "echo 'you can inline'" ] }, { "shell_command": "echo 'single commands'" }, "echo 'for panes'" ] } ]}
Workspace file: packages/LibTmuxWorkspace/test/fixtures/tmuxp/shorthands.yaml.
Tested by tmuxp example catalog
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
A window of two panes.
session_name: 2-pane-verticalwindows: - window_name: my test window panes: - echo hello - echo hello{ "session_name": "2-pane-vertical", "windows": [ { "window_name": "my test window", "panes": [ "echo hello", "echo hello" ] } ]}
Workspace file: packages/LibTmuxWorkspace/test/fixtures/tmuxp/2-pane-vertical.yaml.
Tested by tmuxp example catalog
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
A window of four panes.
session_name: 4-pane-splitwindows: - window_name: dev window layout: tiled shell_command_before: - cd ~/ panes: - shell_command: - cd /var/log - ls -al | grep \.log - echo hello - echo hello - echo hello{ "session_name": "4-pane-split", "windows": [ { "window_name": "dev window", "layout": "tiled", "shell_command_before": [ "cd ~/" ], "panes": [ { "shell_command": [ "cd /var/log", "ls -al | grep \\.log" ] }, "echo hello", "echo hello", "echo hello" ] } ]}
Workspace file: packages/LibTmuxWorkspace/test/fixtures/tmuxp/4-pane.yaml.
Tested by tmuxp example catalog
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
The main-horizontal layout gives the first pane the top of the window and splits the rest below it.
session_name: main-pane-heightstart_directory: "~"windows: - layout: main-horizontal options: main-pane-height: 30 panes: - shell_command: - top start_directory: "~" - shell_command: - echo "hey" - shell_command: - echo "moo" window_name: my window name{ "session_name": "main-pane-height", "start_directory": "~", "windows": [ { "layout": "main-horizontal", "options": { "main-pane-height": 30 }, "panes": [ { "shell_command": [ "top" ], "start_directory": "~" }, { "shell_command": [ "echo \"hey\"" ] }, { "shell_command": [ "echo \"moo\"" ] } ], "window_name": "my window name" } ]}
Workspace file: packages/LibTmuxWorkspace/test/fixtures/tmuxp/main-pane-height.yaml.
Tested by tmuxp example catalog
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
shell_command_before runs ahead of a pane's own commands, at the session, window or pane level.
session_name: dev-${PROJECT}start_directory: ./srcshell_command_before: echo sessionenvironment: COMMON: session SESSION: yes-stringwindows: - window_name: api start_directory: service shell_command_before: echo window environment: COMMON: window WINDOW: inherited panes: - start_directory: ../tools shell_command_before: echo pane shell_command: - echo ${PROJECT} - cmd: literal enter: false - environment: COMMON: pane shell_command: echo ${UNKNOWN}{ "session_name": "dev-${PROJECT}", "start_directory": "./src", "shell_command_before": "echo session", "environment": { "COMMON": "session", "SESSION": "yes-string" }, "windows": [ { "window_name": "api", "start_directory": "service", "shell_command_before": "echo window", "environment": { "COMMON": "window", "WINDOW": "inherited" }, "panes": [ { "start_directory": "../tools", "shell_command_before": "echo pane", "shell_command": [ "echo ${PROJECT}", { "cmd": "literal", "enter": false } ] }, { "environment": { "COMMON": "pane" }, "shell_command": "echo ${UNKNOWN}" } ] } ]}
Workspace file: packages/LibTmuxWorkspace/test/config.jl.
Tested by explicit expansion and inheritance
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
environment sets variables for a session, a window or a pane.
session_name: Environment variables testenvironment: EDITOR: /usr/bin/vim DJANGO_SETTINGS_MODULE: my_app.settings.local SERVER_PORT: "8009"windows: - window_name: Django project panes: - ./manage.py runserver 0.0.0.0:${SERVER_PORT} - window_name: Another Django project environment: DJANGO_SETTINGS_MODULE: my_app.settings.local SERVER_PORT: "8010" panes: - ./manage.py runserver 0.0.0.0:${SERVER_PORT} - environment: DJANGO_SETTINGS_MODULE: my_app.settings.local-testing SERVER_PORT: "8011" shell_command: ./manage.py runserver 0.0.0.0:${SERVER_PORT}{ "session_name": "Environment variables test", "environment": { "EDITOR": "/usr/bin/vim", "DJANGO_SETTINGS_MODULE": "my_app.settings.local", "SERVER_PORT": "8009" }, "windows": [ { "window_name": "Django project", "panes": [ "./manage.py runserver 0.0.0.0:${SERVER_PORT}" ] }, { "window_name": "Another Django project", "environment": { "DJANGO_SETTINGS_MODULE": "my_app.settings.local", "SERVER_PORT": "8010" }, "panes": [ "./manage.py runserver 0.0.0.0:${SERVER_PORT}", { "environment": { "DJANGO_SETTINGS_MODULE": "my_app.settings.local-testing", "SERVER_PORT": "8011" }, "shell_command": "./manage.py runserver 0.0.0.0:${SERVER_PORT}" } ] } ]}
Workspace file: packages/LibTmuxWorkspace/test/fixtures/tmuxp/session-environment.yaml.
Tested by tmuxp example catalog
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
start_directory chooses where a session, a window or a pane starts.
session_name: start directorystart_directory: /var/windows: - window_name: should be /var/ panes: - shell_command: - echo "\033c - it trickles down from session-level" - echo hello - window_name: should be /var/log start_directory: log panes: - shell_command: - echo '\033c - window start_directory concatenates to session start_directory - if it is not absolute' - echo hello - window_name: should be ~ start_directory: "~" panes: - shell_command: - 'echo \\033c ~ has precedence. note: remember to quote ~ in YAML' - echo hello - window_name: should be /bin start_directory: /bin panes: - echo '\033c absolute paths also have precedence.' - echo hello - window_name: should be workspace file's dir
start_directory: ./ panes: - shell_command: - echo '\033c - ./ is relative to workspace file location - ../ will be parent of workspace file - ./test will be \"test\" dir inside dir of workspace file' - shell_command: - echo '\033c - This way you can load up workspaces from projects and maintain - relative paths.'{ "session_name": "start directory", "start_directory": "/var/", "windows": [ { "window_name": "should be /var/", "panes": [ { "shell_command": [ "echo \"\\033c", "it trickles down from session-level\"" ] }, "echo hello" ] }, { "window_name": "should be /var/log", "start_directory": "log", "panes": [ { "shell_command": [ "echo '\\033c", "window start_directory concatenates to session start_directory", "if it is not absolute'" ] }, "echo hello" ] }, { "window_name": "should be ~", "start_directory": "~", "panes": [ { "shell_command": [ "echo \\\\033c ~ has precedence. note: remember to quote ~ in YAML" ] }, "echo hello" ] }, { "window_name": "should be /bin", "start_directory": "/bin", "panes": [ "echo '\\033c absolute paths also have precedence.'", "echo hello" ] }, { "window_name": "should be workspace file's dir", "start_directory": "./", "panes": [ { "shell_command": [ "echo '\\033c", "./ is relative to workspace file location", "../ will be parent of workspace file", "./test will be \\\"test\\\" dir inside dir of workspace file'" ] }, { "shell_command": [ "echo '\\033c", "This way you can load up workspaces from projects and maintain", "relative paths.'" ] } ] } ]}
Workspace file: packages/LibTmuxWorkspace/test/fixtures/tmuxp/start-directory.yaml.
Tested by tmuxp example catalog
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
options_after sets synchronize-panes once the panes exist, so typing in one pane reaches the others.
session_name: 2-pane-synchronizedwindows: - window_name: Two synchronized panes panes: - ssh server1 - ssh server2 options_after: synchronize-panes: on{ "session_name": "2-pane-synchronized", "windows": [ { "window_name": "Two synchronized panes", "panes": [ "ssh server1", "ssh server2" ], "options_after": { "synchronize-panes": "on" } } ]}
Workspace file: packages/LibTmuxWorkspace/test/fixtures/tmuxp/2-pane-synchronized.yaml.
Tested by tmuxp example catalog
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
An empty entry, null, pane or blank opens a pane with no command.
session_name: Blank pane testwindows: # Emptiness will simply open a blank pane, if no shell_command_before. # All these are equivalent - window_name: Blank pane test panes: - - pane - blank - window_name: More blank panes panes: - null - shell_command: - shell_command: - # an empty string will be treated as a carriage return - window_name: Empty string (return) panes: - "" - shell_command: "" - shell_command: - "" # a pane can have other options but still be blank - window_name: Blank with options panes: - focus: true - start_directory: /tmp{ "session_name": "Blank pane test", "windows": [ { "window_name": "Blank pane test", "panes": [ null, "pane", "blank" ] }, { "window_name": "More blank panes", "panes": [ null, { "shell_command": null }, { "shell_command": [ null ] } ] }, { "window_name": "Empty string (return)", "panes": [ "", { "shell_command": "" }, { "shell_command": [ "" ] } ] }, { "window_name": "Blank with options", "panes": [ { "focus": true }, { "start_directory": "/tmp" } ] } ]}
Workspace file: packages/LibTmuxWorkspace/test/fixtures/tmuxp/blank-panes.yaml.
Tested by tmuxp example catalog
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
A ${VAR} in a name, a path or an option expands from the environment of the loading process.
start_directory: "${PWD}/test"shell_command_before: "echo ${PWD}"before_script: "${MY_ENV_VAR}/test3.sh"session_name: session - ${USER} (${MY_ENV_VAR})windows: - window_name: editor panes: - shell_command: - tail -F /var/log/syslog start_directory: /var/log - window_name: logging for ${USER} options: automatic-rename: true panes: - shell_command: - htop - ls $PWD{ "start_directory": "${PWD}/test", "shell_command_before": "echo ${PWD}", "before_script": "${MY_ENV_VAR}/test3.sh", "session_name": "session - ${USER} (${MY_ENV_VAR})", "windows": [ { "window_name": "editor", "panes": [ { "shell_command": [ "tail -F /var/log/syslog" ] } ], "start_directory": "/var/log" }, { "window_name": "logging for ${USER}", "options": { "automatic-rename": true }, "panes": [ { "shell_command": [ "htop", "ls $PWD" ] } ] } ]}
Workspace file: packages/LibTmuxWorkspace/test/fixtures/tmuxp/env-variables.yaml.
Tested by tmuxp example catalog
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
focus: true selects a window or a pane when the session is built.
session_name: focuswindows: - window_name: attached window focus: true panes: - shell_command: - echo hello - echo 'this pane should be selected on load' focus: true - shell_command: - cd /var/log - echo hello - window_name: second window shell_command_before: cd /var/log panes: - pane - shell_command: - echo 'this pane should be focused, when window switched to first time' focus: true - pane{ "session_name": "focus", "windows": [ { "window_name": "attached window", "focus": true, "panes": [ { "shell_command": [ "echo hello", "echo 'this pane should be selected on load'" ], "focus": true }, { "shell_command": [ "cd /var/log", "echo hello" ] } ] }, { "window_name": "second window", "shell_command_before": "cd /var/log", "panes": [ "pane", { "shell_command": [ "echo 'this pane should be focused, when window switched to first time'" ], "focus": true }, "pane" ] } ]}
Workspace file: packages/LibTmuxWorkspace/test/fixtures/tmuxp/focus-window-and-panes.yaml.
Tested by tmuxp example catalog
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
main-pane-height takes a percentage of the window as well as a row count.
session_name: main-pane-heightstart_directory: "~"windows: - layout: main-horizontal options: main-pane-height: 67% panes: - shell_command: - top start_directory: "~" - shell_command: - echo "hey" - shell_command: - echo "moo" window_name: my window name{ "session_name": "main-pane-height", "start_directory": "~", "windows": [ { "layout": "main-horizontal", "options": { "main-pane-height": "67%" }, "panes": [ { "shell_command": [ "top" ], "start_directory": "~" }, { "shell_command": [ "echo \"hey\"" ] }, { "shell_command": [ "echo \"moo\"" ] } ], "window_name": "my window name" } ]}
Workspace file: packages/LibTmuxWorkspace/test/fixtures/tmuxp/main-pane-height-percentage.yaml.
Tested by tmuxp example catalog
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
A pane can start its own shell or program, and window_shell sets the default for a window.
session_name: Pane shell examplewindows: - window_name: first window_shell: /usr/bin/python2 layout: even-vertical suppress_history: false options: remain-on-exit: true panes: - shell: /usr/bin/python3 shell_command: - print('This is python 3') - shell: /usr/bin/vim -u none shell_command: - iAll panes have the `remain-on-exit` setting on. - When you exit out of the shell or application, the panes will remain. - Use tmux command `:kill-pane` to remove the pane. - Use tmux command `:respawn-pane` to restart the shell in the pane. - Use <Escape> and then `:q!` to get out of this vim window. :-) - shell_command: - print('Hello World 2') - shell: /usr/bin/top{ "session_name": "Pane shell example", "windows": [ { "window_name": "first", "window_shell": "/usr/bin/python2", "layout": "even-vertical", "suppress_history": false, "options": { "remain-on-exit": true }, "panes": [ { "shell": "/usr/bin/python3", "shell_command": [ "print('This is python 3')" ] }, { "shell": "/usr/bin/vim -u none", "shell_command": [ "iAll panes have the `remain-on-exit` setting on.", "When you exit out of the shell or application, the panes will remain.", "Use tmux command `:kill-pane` to remove the pane.", "Use tmux command `:respawn-pane` to restart the shell in the pane.", "Use <Escape> and then `:q!` to get out of this vim window. :-)" ] }, { "shell_command": [ "print('Hello World 2')" ] }, { "shell": "/usr/bin/top" } ] } ]}
Workspace file: packages/LibTmuxWorkspace/test/fixtures/tmuxp/pane-shell.yaml.
Tested by tmuxp example catalog
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
suppress_history chooses whether commands reach the shell history, per session, window, pane or command.
session_name: suppresssuppress_history: falsewindows: - window_name: appended focus: true suppress_history: false panes: - echo "window in the history!"
- window_name: suppressed suppress_history: true panes: - echo "window not in the history!"
- window_name: default panes: - echo "session in the history!"
- window_name: mixed suppress_history: false panes: - shell_command: - echo "command in the history!" suppress_history: false - shell_command: - echo "command not in the history!" suppress_history: true - shell_command: - echo "window in the history!"{ "session_name": "suppress", "suppress_history": false, "windows": [ { "window_name": "appended", "focus": true, "suppress_history": false, "panes": [ "echo \"window in the history!\"" ] }, { "window_name": "suppressed", "suppress_history": true, "panes": [ "echo \"window not in the history!\"" ] }, { "window_name": "default", "panes": [ "echo \"session in the history!\"" ] }, { "window_name": "mixed", "suppress_history": false, "panes": [ { "shell_command": [ "echo \"command in the history!\"" ], "suppress_history": false }, { "shell_command": [ "echo \"command not in the history!\"" ], "suppress_history": true }, { "shell_command": [ "echo \"window in the history!\"" ] } ] } ]}
Workspace file: packages/LibTmuxWorkspace/test/fixtures/tmuxp/suppress-history.yaml.
Tested by tmuxp example catalog
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
window_index places a window at an index; a window without one takes the lowest free index.
session_name: Window index examplewindows: - window_name: zero panes: - echo "this window's index will be zero" - window_name: five panes: - echo "this window's index will be five" window_index: 5 - window_name: one panes: - echo "this window's index will be one"{ "session_name": "Window index example", "windows": [ { "window_name": "zero", "panes": [ "echo \"this window's index will be zero\"" ] }, { "window_name": "five", "panes": [ "echo \"this window's index will be five\"" ], "window_index": 5 }, { "window_name": "one", "panes": [ "echo \"this window's index will be one\"" ] } ]}
Workspace file: packages/LibTmuxWorkspace/test/fixtures/tmuxp/window-index.yaml.
Tested by tmuxp example catalog
(packages/LibTmuxWorkspace/test/config.jl; loaded by the library in a test; the command is not run).
LibTmuxWorkspaceThe workspace package is separate from the core library.
using Pkg
Pkg.activate(".")
repo = "https://github.com/libtmux/libtmux-julia.git"
ref = "ad641d77d03750c6c0e04b623cf267c86c0d0974"
Pkg.add([
PackageSpec(url=repo, rev=ref),
PackageSpec(url=repo, rev=ref, subdir="packages/LibTmuxWorkspace"),
])$ libtmux-workspace load ./workspace.yamlRun in Julia. Neither package is registered in General, so this installs from Git. Add the core and workspace packages in one call so both use the same revision.
config = validate( Dict( "session_name" => "workspace-example", "options" => Dict("default-shell" => "/bin/sh"), "windows" => [ Dict( "window_name" => "editor", "window_index" => 0, "layout" => "even-horizontal", "focus" => true, "panes" => [ Dict( "shell_command" => [ Dict("cmd" => "printf ready", "enter" => false), ], ), Dict("focus" => true), ], ), ], ),)prepared = plan(expand(config; base_directory=dirname(server.socket_path)))result = apply(server, prepared; rollback=:created)@assert result.status == :complete
Excerpt of packages/LibTmuxWorkspace/examples/owned_load.jl.
This program is tested on every change.
Subject-by-subject, with Julia in every code block.
Task guides for Julia.
Complete programs, sourced from the code each port tests.
The domain model every port shares.
Reference preview