Session
tmux(1) Session [session_manual].
Source and package
-
Examples#
>>> sessionSession($1 ...)>>> session.windows[Window(@1 ...:..., Session($1 ...)]>>> session.active_windowWindow(@1 ...:..., Session($1 ...))>>> session.active_panePane(%1 Window(@1 ...:..., Session($1 ...)))The session can be used as a context manager to ensure proper cleanup:
>>> with server.new_session() as session:... window = session.new_window()... # Do work with the window... # Session will be killed automatically when exiting the contextReferences#
- [session_manual]
-
tmux session. openbsd manpage for TMUX(1). "When tmux is started it creates a new session with a single window and displays it on screen..." "A session is a single collection of pseudo terminals under the management of tmux. Each session has one or more windows linked to it." https://man.openbsd.org/tmux.1#DESCRIPTION. Accessed April 1st, 2018.
Discussed in Server, session, window, pane , Workspaces · Python workspace internal API · Architecture , Ownership and cleanup
In other ports A tmux session
- PowerShell
LibTmux\Get-TmuxSessionThis cmdlet reads and returns shared .NET
LibTmux.Sessionobjects. Child windows and panes require further acquisition. - Julia
LibTmux.SessionSnapshotSessionSnapshotholds captured session data. Actions use itsSessionRef, a typed identity bound to an observed daemon generation. - Ruby
- Lua
- TypeScript
- Rust
- Go
- Java
- C#
- C++
- Swift
- Kotlin
- Scala
- F#
LibTmux.FSharp.SessionThis F# module builds deferred child queries from a shared .NET
LibTmux.Sessionand its server association.Query.listacquires their results from tmux.
Members44#
Parent objects1#
Collections and queries4#
- windows property Windows contained by session.
- panes property Panes contained by session's windows.
- search_windows method Windows in this session, optionally filtered by tmux.
- search_panes method Panes in this session, optionally filtered by tmux.
Common operations20#
- new_window method Create new window, returns new
Window. - kill method Kill
Session, closes linked windows and detach all clients. - rename_session method Rename session and return new
Sessionobject. - id property Alias of
Session.session_id. - name property Alias of
Session.session_name. - detach_client method Detach every client attached to this session.
- active_window property Return the active
Windowobject. - active_pane property Return the active
Paneobject. - refresh method Refresh session attributes from tmux.
- next_window method Select the next window.
- previous_window method Select the previous window.
- last_window method Select the last (previously selected) window.
- attach method Return
$ tmux attach-sessionaka alias:$ tmux attach. - select_window method Select window and return the selected window.
- cmd method Execute tmux subcommand within session context.
- from_env method Return the session this process's pane belongs to.
- lock_session method Lock this session via
$ tmux lock-session. - kill_window method Close a tmux window, and all panes inside it,
$ tmux kill-window. - switch_client method Switch client to session.
- from_session_id method Create Session from existing session_id.
Other members19#
- default_hook_scope: Option
Scope | None attribute - default_option_scope: Option
Scope | None attribute - attach_session method Return
$ tmux attach-sessionaka alias:$ tmux attach. - attached_pane property Return the active
Paneobject. - attached_window property Return the active
Windowobject. - children property Was used by TmuxRelationalObject (but that's longer used in this class).
- find_where method Filter through windows, return first
Window. - get method Return key-based lookup. Deprecated by attributes.
- get_by_id method Return window by id. Deprecated in favor of
windows.get(). - kill_session method Destroy session.
- list_windows method Return a list of
Windowfrom thetmux(1)session. - where method Filter through windows, return list of
Window. - __enter__ method Enter the context, returning self.
- __eq__ method Equal operator for
Sessionobject. - __exit__ method Exit the context, killing the session if it exists.
- __getitem__ method Return item lookup by key. Deprecated in favor of attributes.
- __repr__ method Representation of
Sessionobject. - _list_windows method Return list of windows (deprecated in favor of
windows). - _windows property Property / alias to return
Session._list_windows.
Inherited members204 members#
Reached through libtmux.hooks.HooksMixin, libtmux.options.OptionsMixin, libtmux.neo.Obj, libtmux.common.EnvironmentMixin.
- show_hooks method inherited Return a dict of hooks for the target.
- show_options method inherited Return all options for the target.
- session_attached attribute inherited
- show_environment method inherited Show environment
$ tmux show-environment -t [session]. - set_option method inherited Set option for tmux target.
- unset_option method inherited Unset option for tmux target.
- set_hook method inherited Set hook for tmux target.
- set_environment method inherited Set environment
$ tmux set-environment <name> <value>. - unset_environment method inherited Unset environment variable
$ tmux set-environment -u <name>. - session_created attribute inherited
- show_option method inherited Return option value for the target.
- unset_hook method inherited Unset hook for tmux target.
- remove_environment method inherited Remove environment variable
$ tmux set-environment -r <name>. - set_hooks method inherited Set multiple indexed hooks at once.
- run_hook method inherited Run a hook immediately. Useful for testing.
- session_group attribute inherited
- session_grouped attribute inherited
- session_last_attached attribute inherited
- show_hook method inherited Return value for a hook.
- active_window_index attribute inherited
- alternate_saved_x attribute inherited
- alternate_saved_y attribute inherited
- bracket_paste_flag attribute inherited
- buffer_name attribute inherited
- buffer_sample attribute inherited
- buffer_size attribute inherited
- client_activity attribute inherited
- client_cell_height attribute inherited
- client_cell_width attribute inherited
- client_control_mode attribute inherited
- client_created attribute inherited
- client_discarded attribute inherited
- client_flags attribute inherited
- client_height attribute inherited
- client_key_table attribute inherited
- client_last_session attribute inherited
- client_mode_format attribute inherited
- client_name attribute inherited
- client_pid attribute inherited
- client_prefix attribute inherited
- client_readonly attribute inherited
- client_session attribute inherited
- client_termfeatures attribute inherited
- client_termname attribute inherited
- client_termtype attribute inherited
- client_tty attribute inherited
- client_uid attribute inherited
- client_user attribute inherited
- client_utf8 attribute inherited
- client_width attribute inherited
- client_written attribute inherited
- command_list_alias attribute inherited
- command_list_name attribute inherited
- command_list_usage attribute inherited
- config_files attribute inherited
- copy_cursor_line attribute inherited
- copy_cursor_word attribute inherited
- copy_cursor_x attribute inherited
- copy_cursor_y attribute inherited
- current_file attribute inherited
- cursor_character attribute inherited
- cursor_flag attribute inherited
- cursor_x attribute inherited
- cursor_y attribute inherited
- getenv method inherited Show environment variable
$ tmux show-environment -t [session] <name>. - history_bytes attribute inherited
- history_limit attribute inherited
- history_size attribute inherited
- hooks attribute inherited
- insert_flag attribute inherited
- keypad_cursor_flag attribute inherited
- keypad_flag attribute inherited
- last_window_index attribute inherited
- line attribute inherited
- mouse_all_flag attribute inherited
- mouse_any_flag attribute inherited
- mouse_button_flag attribute inherited
- mouse_sgr_flag attribute inherited
- mouse_standard_flag attribute inherited
- next_session_id attribute inherited
- origin_flag attribute inherited
- pane_active attribute inherited
- pane_at_bottom attribute inherited
- pane_at_left attribute inherited
- pane_at_right attribute inherited
- pane_at_top attribute inherited
- pane_bg attribute inherited
- pane_bottom attribute inherited
- pane_current_command attribute inherited
- pane_current_path attribute inherited
- pane_dead attribute inherited
- pane_dead_signal attribute inherited
- pane_dead_status attribute inherited
- pane_dead_time attribute inherited
- pane_fg attribute inherited
- pane_flags attribute inherited
- pane_floating_flag attribute inherited
- pane_format attribute inherited
- pane_height attribute inherited
- pane_id attribute inherited
- pane_in_mode attribute inherited
- pane_index attribute inherited
- pane_input_off attribute inherited
- pane_last attribute inherited
- pane_left attribute inherited
- pane_marked attribute inherited
- pane_marked_set attribute inherited
- pane_mode attribute inherited
- pane_path attribute inherited
- pane_pb_progress attribute inherited
- pane_pb_state attribute inherited
- pane_pid attribute inherited
- pane_pipe attribute inherited
- pane_pipe_pid attribute inherited
- pane_right attribute inherited
- pane_search_string attribute inherited
- pane_start_command attribute inherited
- pane_start_path attribute inherited
- pane_synchronized attribute inherited
- pane_tabs attribute inherited
- pane_title attribute inherited
- pane_top attribute inherited
- pane_tty attribute inherited
- pane_width attribute inherited
- pane_x attribute inherited
- pane_y attribute inherited
- pane_z attribute inherited
- pane_zoomed_flag attribute inherited
- pid attribute inherited
- scroll_position attribute inherited
- scroll_region_lower attribute inherited
- scroll_region_upper attribute inherited
- search_match attribute inherited
- selection_end_x attribute inherited
- selection_end_y attribute inherited
- selection_start_x attribute inherited
- selection_start_y attribute inherited
- session_activity attribute inherited
- session_alerts attribute inherited
- session_attached_list attribute inherited
- session_format attribute inherited
- session_group_attached attribute inherited
- session_group_attached_list attribute inherited
- session_group_list attribute inherited
- session_group_many_attached attribute inherited
- session_group_size attribute inherited
- session_id attribute inherited
- session_many_attached attribute inherited
- session_marked attribute inherited
- session_name attribute inherited
- session_path attribute inherited
- session_stack attribute inherited
- session_windows attribute inherited
- socket_path attribute inherited
- start_time attribute inherited
- synchronized_output_flag attribute inherited
- uid attribute inherited
- user attribute inherited
- version attribute inherited
- window_active attribute inherited
- window_active_clients attribute inherited
- window_active_clients_list attribute inherited
- window_active_sessions attribute inherited
- window_active_sessions_list attribute inherited
- window_activity attribute inherited
- window_activity_flag attribute inherited
- window_bell_flag attribute inherited
- window_bigger attribute inherited
- window_cell_height attribute inherited
- window_cell_width attribute inherited
- window_end_flag attribute inherited
- window_flags attribute inherited
- window_format attribute inherited
- window_height attribute inherited
- window_id attribute inherited
- window_index attribute inherited
- window_last_flag attribute inherited
- window_layout attribute inherited
- window_linked attribute inherited
- window_linked_sessions attribute inherited
- window_linked_sessions_list attribute inherited
- window_marked_flag attribute inherited
- window_name attribute inherited
- window_offset_x attribute inherited
- window_offset_y attribute inherited
- window_panes attribute inherited
- window_raw_flags attribute inherited
- window_silence_flag attribute inherited
- window_stack_index attribute inherited
- window_start_flag attribute inherited
- window_visible_layout attribute inherited
- window_width attribute inherited
- window_zoomed_flag attribute inherited
- wrap_flag attribute inherited
- __init__ method inherited
- _add_option attribute inherited
- _refresh method inherited Refresh dataclass fields from a single
list-*row. - _show_hook method inherited Return value for the hook.
- _show_option method inherited Return option value for the target.
- _show_option_raw method inherited Return raw option output for target.
- _show_options method inherited Return a dict of options for the target.
- _show_options_dict method inherited Return dict of options for the target.
- _show_options_raw method inherited Return a dict of options for the target.
- _tmux_bin property inherited Resolve tmux_bin from self (Server) or self.server (Session/Window/Pane).