-
Notifications
You must be signed in to change notification settings - Fork 232
Allow specifying file name and format as cmd args for freeze, deduce format from filename #701
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
Allow specifying file name and format as cmd args for freeze, deduce format from filename #701
Conversation
@davidatbu Thank you! I'm wondering why tests aren't showing up in GH actions. Can you try rebasing? |
|
@davidatbu Here is another ping, can you try giving this a rebase please? |
|
@davidatbu Sorry about this! This is extremely difficult to handle without a rebase, I don't have force push access to do it myself I'd like you to get credit for the pull request being merged here but i may have to make a separate PR with this change. |
b7081ac
to
3fe3a0f
Compare
…freeze, deduce format from filename
3fe3a0f
to
a1e01ff
Compare
Codecov Report
@@ Coverage Diff @@
## master #701 +/- ##
==========================================
+ Coverage 75.91% 75.96% +0.05%
==========================================
Files 7 7
Lines 1179 1190 +11
Branches 306 311 +5
==========================================
+ Hits 895 904 +9
+ Misses 201 199 -2
- Partials 83 87 +4
Continue to review full report at Codecov.
|
First off, thanks for this Python solution to tmux session management! Works quite well.
tmuxp freeze
does a lot of prompting, but I wanted the option to not be prompted sometimes (for example, I want to setup a binding in tmux that saves the current session in the current directory, and I don't want to be prompted for file name / file format).So this commit adds the following:
-o
/--save-to
option. If the user doesn't provide it, we will prompt.-f
/--config-format
option. If the user doesn't provide it, we'll try to deduce it from the extension of the file specified by the--save-to
option. If that doesn't give a valid format, we prompt the user.-y
/--yes
option. In addition to the prompts for the above two, we currently prompt for cofnrimation/warning two additional times when doingfreeze
. Specifying this-y
flag avoids that.-q
/--quiet
option reduces some informative output. This is mostly a personal preference. I like my command line tools to be as quiet as possible.I haven't touched the tests here. I wanted to confirm that there was interest from the maintainers first.
A good demonstration of what the above changes enable is the following tmux mapping:
This silently saves the current session in the current working directory of tmux after pressing Ctrl-S.