Core LibraryAPI Reference

Choose documentation 3

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

C# API

method libtmux-dotnet latest

Server.RunShellAsync

Namespace LibTmux.Server.RunShellAsync LibTmux

Runs a shell command and reports what it printed.

View as Markdown

Source and package
Module
LibTmux
Declared in
Server
Package
LibTmux
Source
src/LibTmux/Server.Execution.cs
Other languages
PythonRuby Lua TypeScriptRustGoJavaC++ Swift Kotlin Scala F#
RunShellAsync ( request : RunShellRequest , cancellationToken : CancellationToken ) → Task<IReadOnlyList<string>?>
methodasync [source]

Description#

The directory flag arrived in tmux 3.4, the error-output flag in 3.6, and passing arguments without a shell in 3.7. On tmux 3.3a and 3.4, shell text goes to pane view mode, so the process request can return an empty collection even when the shell printed lines.

Parameters
  • request ( RunShellRequest ) – What to run, and how.

  • cancellationToken ( CancellationToken ) – Cancels waiting for tmux's reply. tmux itself is not told: the server, not this process, owns run-shell's spawned command, so cancelling stops this call from waiting on it, not the command from running. Nor does stopping the whole server: KillAsync does not reap a run-shell child either, so it keeps running as its own orphaned process.

Returns

What the command printed, or null when tmux did not wait for it.

tmux command run-shell

In other ports Run a shell command through tmux
Esc

Type to search.