Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for -f flag to use non-default tmux config file #479

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'master' into support-conf-file
  • Loading branch information
tony committed Feb 5, 2022
commit 033014704f5324329b241901871795841bf02b6b
22 changes: 20 additions & 2 deletions tmuxp/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ def load_workspace(
socket_name=None,
socket_path=None,
tmux_config_file=None,
new_session_name=None,
colors=None,
detached=False,
answer_yes=False,
Expand All @@ -560,6 +561,8 @@ def load_workspace(
``tmux -S <socket-path>``
tmux_config_file: str, optional
``tmux -f <config-file>``
new_session_name: str, options
``tmux new -s <new_session_name>``
colors : str, optional
'-2'
Force tmux to support 256 colors
Expand Down Expand Up @@ -662,8 +665,8 @@ def load_workspace(
t = Server( # create tmux server object
socket_name=socket_name,
socket_path=socket_path,
colors=colors,
config_file=tmux_config_file,
colors=colors,
)

which('tmux') # raise exception if tmux not found
Expand Down Expand Up @@ -998,6 +1001,7 @@ def command_freeze(session_name, socket_name, socket_path, force):
@click.option('-S', 'socket_path', help='pass-through for tmux -S')
@click.option('-L', 'socket_name', help='pass-through for tmux -L')
@click.option('-f', 'tmux_config_file', help='pass-through for tmux -f')
@click.option('-s', 'new_session_name', help='start new session with new session name')
@click.option('--yes', '-y', 'answer_yes', help='yes', is_flag=True)
@click.option(
'-d', 'detached', help='Load the session without attaching it', is_flag=True
Expand All @@ -1021,7 +1025,20 @@ def command_freeze(session_name, socket_name, socket_path, force):
flag_value=88,
help='Like -2, but indicates that the terminal supports 88 colours.',
)
def command_load(ctx, config, socket_name, socket_path, tmux_config_file, answer_yes, detached, colors):
@click.option('--log-file', help='File to log errors/output to')
def command_load(
ctx,
config,
socket_name,
socket_path,
tmux_config_file,
new_session_name,
answer_yes,
detached,
append,
colors,
log_file,
):
"""Load a tmux workspace from each CONFIG.

CONFIG is a specifier for a configuration file.
Expand Down Expand Up @@ -1054,6 +1071,7 @@ def command_load(ctx, config, socket_name, socket_path, tmux_config_file, answer
'socket_name': socket_name,
'socket_path': socket_path,
'tmux_config_file': tmux_config_file,
'new_session_name': new_session_name,
'answer_yes': answer_yes,
'colors': colors,
'detached': detached,
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.