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

Conversation

lins05
Copy link

@lins05 lins05 commented Feb 26, 2019

Thanks for this awesome project! I find it's useful to use a specific tmux.conf when automating some tasks. Hopefully this would be useful for others too.

@TerraTech
Copy link

TerraTech commented Feb 18, 2020

@tony Is there any chance this PR can be merged for next release?

I'm using the patch locally with tmuxp v1.5.4 (Gentoo) and it is working great so far.

@lins05 Thank you for scratching this itch and implementing the "-f" passthrough.

@tony
Copy link
Member

tony commented Aug 16, 2020

@TerraTech Hi there, sorry about this! Can I get another rebase?

I just merged #623 which moves us to a poetry packaging setup and will runs the PR through GitHub actions.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@tony
Copy link
Member

tony commented Jan 29, 2022

@lins05

Hi, sorry for letting this go on so long, that's my fault.

Can you please rebase the PR and solve on the conflicts?

If there's no response I'll assume this is ok to close, but you'd be welcome to remake the PR in the future.

@TerraTech
Copy link

@tony If @lins05 has fallen off the grid, would you accept the patch in a new PR from myself to get this merged in? I ask because of the the CLA that needs to be signed, and I'm not sure how that works when someone else has authored the patch.

Overall, I'd like to remove the custom patch from my portage build routines.

@paulmsmith
Copy link

New machine and just got to this problem. Would love this to be resolved and merged.

@codecov
Copy link

codecov bot commented Feb 5, 2022

Codecov Report

Merging #479 (0330147) into master (a937b4b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #479   +/-   ##
=======================================
  Coverage   75.91%   75.91%           
=======================================
  Files           7        7           
  Lines        1179     1179           
  Branches      306      306           
=======================================
  Hits          895      895           
  Misses        201      201           
  Partials       83       83           
Impacted Files Coverage Δ
tmuxp/cli.py 73.31% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a937b4b...0330147. Read the comment docs.

@tony
Copy link
Member

tony commented Feb 5, 2022

@paulsmith @TerraTech

-f already works with tmuxp. What makes this different?

e.g. Have you tried tmuxp load with -f? tmuxp load --help?

@tony
Copy link
Member

tony commented Feb 5, 2022

This was in since 1.7.1, Feb 3, 2021, ee8c6e2

Let me know if it works if you try it

Note that this only works for newly started tmux servers (it's an -f passthrough), it doesn't run source-file to apply a config on servers that are already started. That would be a different PR entirely

@paulmsmith
Copy link

It does? I didn't realise @tony, I will check. I just now ended up symlinking .tmux.conf to my dotfiles directory, will revert. Thank you for the swift reply.

@paulmsmith
Copy link

Ah, I saw that:

2022-02-05 at 18 51 00

But my tired mind totally misread it I think.

@paulmsmith
Copy link

@tony Forgive my lack of experience, but should it be something like:

tmuxp load personal -f ~/.files/.tmux.conf

@tony
Copy link
Member

tony commented Feb 5, 2022

@paulmsmith I did a test and yes, like that.

tmuxp load ~/projects/project-a -f ~/example-tmux-config.conf

And this only worked on new sessions.

For subsequence sourcing, you could try tmux source-file ~/path-to-tmux-config.conf in the shell_command_before in the session or window level and see if that works, but note that due to the way tmux works, some config settings are server-wide.

Does this resolve your question btw?

If it does, are you willing to ask it in https://github.com/tmux-python/tmuxp/discussions and answer it? Maybe that can make it easier for people in a similar situation

@paulmsmith
Copy link

Does this resolve your question btw?

It does, thank you @tony I have attempted adding question and answer discussion thread: How to use tmux with custom a tmux.conf file location when using tmuxp?

@tony
Copy link
Member

tony commented Feb 8, 2022

@paulmsmith this additional discussion thread is wonderful! Thank you!

@tony
Copy link
Member

tony commented Feb 8, 2022

@lins05

I am closing this since we already have this in master.

You made this PR first. I missed it. A subsequent PR at #665 added it, and when going through the queue, that was what appeared first from my perspective.

To be clear: me not getting to your PR is my fault. I apologize for that

I promise if you ever do make another contribution here I will make you first priority. You can email me the PR directly so its certain I ese it.

@tony tony closed this Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants