class Tmux::Client
Attributes
@return [Pane] The currently displayed {Pane pane}. @tmuxver >=1.2
@return [Window] The currently displayed {Window window}. @tmuxver >=1.2
@return [String]
@return [Integer]
@return [String]
@tmux show-messages @return [Array<String>] A log of messages @tmuxver >=1.2
@return [Server]
Setting this will make a client switch to another {Session session}.
@tmux switch-client @return [Session]
$TERM of a client.
@return [String]
True if the terminal is using UTF-8.
@return [Boolean]
True if the terminal is using UTF-8.
@return [Boolean]
@return [Integer]
Public Class Methods
# File lib/tmux/client.rb, line 7 def initialize(server, device) @server, @device = server, device end
Public Instance Methods
Opens a command prompt in the client. This may be used to execute commands interactively.
@param [String] template The template is used as the command to
execute. Before the command is executed, the first occurrence of the string '%%' and all occurrences of '%1' are replaced by the response to the first prompt, the second '%%' and all '%2' are replaced with the response to the second prompt, and so on for further prompts. Up to nine prompt responses may be replaced ('%1' to '%9')
@param [Array<String>] prompts prompts is a list
of prompts which are displayed in order; otherwise a single prompt is displayed, constructed from template
@return [void] @tmux command-prompt @todo escape prompts and template
# File lib/tmux/client.rb, line 184 def command_prompt(template, prompts = []) prompts = prompts.join(",") flags = [] flags << "-p #{prompts}" unless prompts.empty? flags << "-t #{identifier}" flags << "\"#{template}\"" @server.invoke_command "command-prompt #{flags.join(" ")}" end
Detaches a client from tmux.
@tmux detach-client @return [void]
# File lib/tmux/client.rb, line 70 def detach @server.invoke_command "detach-client -t #@device" end
Displays a visible indicator of each {Pane pane} shown by a client.
@tmux display-panes @return [void] @tmuxver >=1.0
# File lib/tmux/client.rb, line 117 def display_panes @server.check_for_version!("1.0") @server.invoke_command("display-panes -t #@device") end
Locks a client.
@tmux lock-client @return [void] @tmuxver >=1.1
# File lib/tmux/client.rb, line 79 def lock @server.check_for_version!("1.1") @server.invoke_command "lock-client -t #@device" end
Displays a message.
@param [String] text The message to display @tmux display-message @return [void] @tmuxver >=1.0
# File lib/tmux/client.rb, line 152 def message(text) @server.check_for_version!("1.0") @server.invoke_command "display-message -t #@device \"#{text}\"" end
Refreshs a client.
@tmux refresh-client @return [void]
# File lib/tmux/client.rb, line 97 def refresh @server.invoke_command "refresh-client -t #@device" end
Opens a prompt inside a client allowing a {Window window} index to be entered interactively.
@tmux command-prompt + select-window @return [void]
# File lib/tmux/client.rb, line 162 def select_interactively command_prompt "select-window -t:%%", ["index"] end
# File lib/tmux/client.rb, line 29 def session=(new_session) @server.invoke_command "switch-client -c #@device -t #{new_session.number}" end
Suspends a client.
@tmux suspend-client @return [void]
# File lib/tmux/client.rb, line 89 def suspend @server.invoke_command "suspend-client -c #@device" end