On this page
libtmux.Session
- Module
- libtmux
- Package
- libtmux
- Source
- src/libtmux/session.py
-
tmux(1) Session [session_manual].
Holds
Windowobjects.Examples
>>> session Session($1 ...)>>> session.windows [Window(@1 ...:..., Session($1 ...)]>>> session.active_window Window(@1 ...:..., Session($1 ...))>>> session.active_pane Pane(%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.
44 declared, 204 inherited
Members
- default_hook_scope attribute
- default_option_scope attribute
- server attribute
- __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). - attach method Return
$ tmux attach-sessionaka alias:$ tmux attach. - attach_session method Return
$ tmux attach-sessionaka alias:$ tmux attach. - cmd method Execute tmux subcommand within session context.
- detach_client method Detach every client attached to this session.
- find_where method Filter through windows, return first
Window. - from_env method Return the session this process's pane belongs to.
- from_session_id method Create Session from existing session_id.
- get method Return key-based lookup. Deprecated by attributes.
- get_by_id method Return window by id. Deprecated in favor of
windows.get(). - kill method Kill
Session, closes linked windows and detach all clients. - kill_session method Destroy session.
- kill_window method Close a tmux window, and all panes inside it,
$ tmux kill-window. - last_window method Select the last (previously selected) window.
- list_windows method Return a list of
Windowfrom thetmux(1)session. - lock_session method Lock this session via
$ tmux lock-session. - new_window method Create new window, returns new
Window. - next_window method Select the next window.
- previous_window method Select the previous window.
- refresh method Refresh session attributes from tmux.
- rename_session method Rename session and return new
Sessionobject. - search_panes method Panes in this session, optionally filtered by tmux.
- search_windows method Windows in this session, optionally filtered by tmux.
- select_window method Select window and return the selected window.
- switch_client method Switch client to session.
- where method Filter through windows, return list of
Window. - _windows property Property / alias to return
Session._list_windows. - active_pane property Return the active
Paneobject. - active_window property Return the active
Windowobject. - 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).
- id property Alias of
Session.session_id. - name property Alias of
Session.session_name. - panes property Panes contained by session's windows.
- windows property Windows contained by session.
Inherited members
Reached through libtmux.common.EnvironmentMixin, libtmux.neo.Obj, libtmux.hooks.HooksMixin, libtmux.options.OptionsMixin.
- _add_option libtmux.common.EnvironmentMixin
- active_window_index libtmux.neo.Obj
- alternate_saved_x libtmux.neo.Obj
- alternate_saved_y libtmux.neo.Obj
- bracket_paste_flag libtmux.neo.Obj
- buffer_name libtmux.neo.Obj
- buffer_sample libtmux.neo.Obj
- buffer_size libtmux.neo.Obj
- client_activity libtmux.neo.Obj
- client_cell_height libtmux.neo.Obj
- client_cell_width libtmux.neo.Obj
- client_control_mode libtmux.neo.Obj
- client_created libtmux.neo.Obj
- client_discarded libtmux.neo.Obj
- client_flags libtmux.neo.Obj
- client_height libtmux.neo.Obj
- client_key_table libtmux.neo.Obj
- client_last_session libtmux.neo.Obj
- client_mode_format libtmux.neo.Obj
- client_name libtmux.neo.Obj
- client_pid libtmux.neo.Obj
- client_prefix libtmux.neo.Obj
- client_readonly libtmux.neo.Obj
- client_session libtmux.neo.Obj
- client_termfeatures libtmux.neo.Obj
- client_termname libtmux.neo.Obj
- client_termtype libtmux.neo.Obj
- client_tty libtmux.neo.Obj
- client_uid libtmux.neo.Obj
- client_user libtmux.neo.Obj
- client_utf8 libtmux.neo.Obj
- client_width libtmux.neo.Obj
- client_written libtmux.neo.Obj
- command_list_alias libtmux.neo.Obj
- command_list_name libtmux.neo.Obj
- command_list_usage libtmux.neo.Obj
- config_files libtmux.neo.Obj
- copy_cursor_line libtmux.neo.Obj
- copy_cursor_word libtmux.neo.Obj
- copy_cursor_x libtmux.neo.Obj
- copy_cursor_y libtmux.neo.Obj
- current_file libtmux.neo.Obj
- cursor_character libtmux.neo.Obj
- cursor_flag libtmux.neo.Obj
- cursor_x libtmux.neo.Obj
- cursor_y libtmux.neo.Obj
- history_bytes libtmux.neo.Obj
- history_limit libtmux.neo.Obj
- history_size libtmux.neo.Obj
- hooks libtmux.hooks.HooksMixin
- insert_flag libtmux.neo.Obj
- keypad_cursor_flag libtmux.neo.Obj
- keypad_flag libtmux.neo.Obj
- last_window_index libtmux.neo.Obj
- line libtmux.neo.Obj
- mouse_all_flag libtmux.neo.Obj
- mouse_any_flag libtmux.neo.Obj
- mouse_button_flag libtmux.neo.Obj
- mouse_sgr_flag libtmux.neo.Obj
- mouse_standard_flag libtmux.neo.Obj
- next_session_id libtmux.neo.Obj
- origin_flag libtmux.neo.Obj
- pane_active libtmux.neo.Obj
- pane_at_bottom libtmux.neo.Obj
- pane_at_left libtmux.neo.Obj
- pane_at_right libtmux.neo.Obj
- pane_at_top libtmux.neo.Obj
- pane_bg libtmux.neo.Obj
- pane_bottom libtmux.neo.Obj
- pane_current_command libtmux.neo.Obj
- pane_current_path libtmux.neo.Obj
- pane_dead libtmux.neo.Obj
- pane_dead_signal libtmux.neo.Obj
- pane_dead_status libtmux.neo.Obj
- pane_dead_time libtmux.neo.Obj
- pane_fg libtmux.neo.Obj
- pane_flags libtmux.neo.Obj
- pane_floating_flag libtmux.neo.Obj
- pane_format libtmux.neo.Obj
- pane_height libtmux.neo.Obj
- pane_id libtmux.neo.Obj
- pane_in_mode libtmux.neo.Obj
- pane_index libtmux.neo.Obj
- pane_input_off libtmux.neo.Obj
- pane_last libtmux.neo.Obj
- pane_left libtmux.neo.Obj
- pane_marked libtmux.neo.Obj
- pane_marked_set libtmux.neo.Obj
- pane_mode libtmux.neo.Obj
- pane_path libtmux.neo.Obj
- pane_pb_progress libtmux.neo.Obj
- pane_pb_state libtmux.neo.Obj
- pane_pid libtmux.neo.Obj
- pane_pipe libtmux.neo.Obj
- pane_pipe_pid libtmux.neo.Obj
- pane_right libtmux.neo.Obj
- pane_search_string libtmux.neo.Obj
- pane_start_command libtmux.neo.Obj
- pane_start_path libtmux.neo.Obj
- pane_synchronized libtmux.neo.Obj
- pane_tabs libtmux.neo.Obj
- pane_title libtmux.neo.Obj
- pane_top libtmux.neo.Obj
- pane_tty libtmux.neo.Obj
- pane_width libtmux.neo.Obj
- pane_x libtmux.neo.Obj
- pane_y libtmux.neo.Obj
- pane_z libtmux.neo.Obj
- pane_zoomed_flag libtmux.neo.Obj
- pid libtmux.neo.Obj
- scroll_position libtmux.neo.Obj
- scroll_region_lower libtmux.neo.Obj
- scroll_region_upper libtmux.neo.Obj
- search_match libtmux.neo.Obj
- selection_end_x libtmux.neo.Obj
- selection_end_y libtmux.neo.Obj
- selection_start_x libtmux.neo.Obj
- selection_start_y libtmux.neo.Obj
- session_activity libtmux.neo.Obj
- session_alerts libtmux.neo.Obj
- session_attached libtmux.neo.Obj
- session_attached_list libtmux.neo.Obj
- session_created libtmux.neo.Obj
- session_format libtmux.neo.Obj
- session_group libtmux.neo.Obj
- session_group_attached libtmux.neo.Obj
- session_group_attached_list libtmux.neo.Obj
- session_group_list libtmux.neo.Obj
- session_group_many_attached libtmux.neo.Obj
- session_group_size libtmux.neo.Obj
- session_grouped libtmux.neo.Obj
- session_id libtmux.neo.Obj
- session_last_attached libtmux.neo.Obj
- session_many_attached libtmux.neo.Obj
- session_marked libtmux.neo.Obj
- session_name libtmux.neo.Obj
- session_path libtmux.neo.Obj
- session_stack libtmux.neo.Obj
- session_windows libtmux.neo.Obj
- socket_path libtmux.neo.Obj
- start_time libtmux.neo.Obj
- synchronized_output_flag libtmux.neo.Obj
- uid libtmux.neo.Obj
- user libtmux.neo.Obj
- version libtmux.neo.Obj
- window_active libtmux.neo.Obj
- window_active_clients libtmux.neo.Obj
- window_active_clients_list libtmux.neo.Obj
- window_active_sessions libtmux.neo.Obj
- window_active_sessions_list libtmux.neo.Obj
- window_activity libtmux.neo.Obj
- window_activity_flag libtmux.neo.Obj
- window_bell_flag libtmux.neo.Obj
- window_bigger libtmux.neo.Obj
- window_cell_height libtmux.neo.Obj
- window_cell_width libtmux.neo.Obj
- window_end_flag libtmux.neo.Obj
- window_flags libtmux.neo.Obj
- window_format libtmux.neo.Obj
- window_height libtmux.neo.Obj
- window_id libtmux.neo.Obj
- window_index libtmux.neo.Obj
- window_last_flag libtmux.neo.Obj
- window_layout libtmux.neo.Obj
- window_linked libtmux.neo.Obj
- window_linked_sessions libtmux.neo.Obj
- window_linked_sessions_list libtmux.neo.Obj
- window_marked_flag libtmux.neo.Obj
- window_name libtmux.neo.Obj
- window_offset_x libtmux.neo.Obj
- window_offset_y libtmux.neo.Obj
- window_panes libtmux.neo.Obj
- window_raw_flags libtmux.neo.Obj
- window_silence_flag libtmux.neo.Obj
- window_stack_index libtmux.neo.Obj
- window_start_flag libtmux.neo.Obj
- window_visible_layout libtmux.neo.Obj
- window_width libtmux.neo.Obj
- window_zoomed_flag libtmux.neo.Obj
- wrap_flag libtmux.neo.Obj
- __init__ libtmux.common.EnvironmentMixin
- _refresh libtmux.neo.Obj Refresh dataclass fields from a single
list-*row. - _show_hook libtmux.hooks.HooksMixin Return value for the hook.
- _show_option libtmux.options.OptionsMixin Return option value for the target.
- _show_option_raw libtmux.options.OptionsMixin Return raw option output for target.
- _show_options libtmux.options.OptionsMixin Return a dict of options for the target.
- _show_options_dict libtmux.options.OptionsMixin Return dict of options for the target.
- _show_options_raw libtmux.options.OptionsMixin Return a dict of options for the target.
- getenv libtmux.common.EnvironmentMixin Show environment variable
$ tmux show-environment -t [session] <name>. - remove_environment libtmux.common.EnvironmentMixin Remove environment variable
$ tmux set-environment -r <name>. - run_hook libtmux.hooks.HooksMixin Run a hook immediately. Useful for testing.
- set_environment libtmux.common.EnvironmentMixin Set environment
$ tmux set-environment <name> <value>. - set_hook libtmux.hooks.HooksMixin Set hook for tmux target.
- set_hooks libtmux.hooks.HooksMixin Set multiple indexed hooks at once.
- set_option libtmux.options.OptionsMixin Set option for tmux target.
- show_environment libtmux.common.EnvironmentMixin Show environment
$ tmux show-environment -t [session]. - show_hook libtmux.hooks.HooksMixin Return value for a hook.
- show_hooks libtmux.hooks.HooksMixin Return a dict of hooks for the target.
- show_option libtmux.options.OptionsMixin Return option value for the target.
- show_options libtmux.options.OptionsMixin Return all options for the target.
- unset_environment libtmux.common.EnvironmentMixin Unset environment variable
$ tmux set-environment -u <name>. - unset_hook libtmux.hooks.HooksMixin Unset hook for tmux target.
- unset_option libtmux.options.OptionsMixin Unset option for tmux target.
- _tmux_bin libtmux.hooks.HooksMixin Resolve tmux_bin from self (Server) or self.server (Session/Window/Pane).