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

Add shell-configuration to pane layer #672

Merged
merged 3 commits into from
Jan 29, 2022
Merged

Conversation

jerri
Copy link
Contributor

@jerri jerri commented Mar 3, 2021

This is supposed to fix #139.

I added a shell-configuration to the pane layer. This way you can specify for every pane what shell/application is supposed to be started. I added an example to the documentation to drive the point home why it makes sense.

I wasn't really able to understand how to add the test cases to the test environment. I hope someone can help with this. The example should hopefully already contain most edge cases in any case.

The more complicated part was to make sure that the shell command for the first pane gets respected by the window creation, as the shell for the first pane has to be handed over to the create-window-command.

@codecov
Copy link

codecov bot commented Mar 3, 2021

Codecov Report

Merging #672 (2ad5f96) into master (d20e653) will decrease coverage by 0.28%.
The diff coverage is 45.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #672      +/-   ##
==========================================
- Coverage   75.51%   75.23%   -0.29%     
==========================================
  Files           8        8              
  Lines        1168     1179      +11     
  Branches      295      298       +3     
==========================================
+ Hits          882      887       +5     
- Misses        205      209       +4     
- Partials       81       83       +2     
Impacted Files Coverage Δ
tmuxp/workspacebuilder.py 85.26% <45.45%> (-2.45%) ⬇️

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 d20e653...2ad5f96. Read the comment docs.

@jerri
Copy link
Contributor Author

jerri commented Mar 16, 2021

Is there anything I can do, to further this merge requests? I am struggling with the test environment. Maybe someone can give me a hand or a hint.

@tony
Copy link
Member

tony commented Jul 18, 2021

@jerri can you rebase this? Sorry for the delay!

Have you seen the developer documentation here? https://tmuxp.git-pull.com/developing.html

Maybe someone can give me a hand or a hint.

Are you able to run the tests locally? What part of this are you having issues with? e.g. writing a new test?

@jerri
Copy link
Contributor Author

jerri commented Jul 24, 2021

I didn't have an idea how to add an appropriate automatic check. On top the automatic tests don't worked on my mac. I found reasons why, but not how to fix them. Added the information to another ticket, that also mentioned the problems.
I can do the rebase. Sure.

@jerri
Copy link
Contributor Author

jerri commented Jul 24, 2021

I fixed the conflict. And push the new version.
I also found my comment in #620 (comment) about the problem I had with the unit testing. When commenting out the mentioned test, I could complete the whole test procedure. Unfortunately I sort of ran out of time and couldn't continue on understanding how the test environment works and how to add automatic testing for my change.

@tony
Copy link
Member

tony commented Oct 30, 2021

@jerri Hi, sorry for the delay!

Can you rebase / solve conflicts? (Interestingly I'm not seeing the tests show up)

@jerri
Copy link
Contributor Author

jerri commented Dec 21, 2021

There shouldn't be any more conflict, no? At least I don't see any conflicts mentioned in this pull request.

@tony
Copy link
Member

tony commented Dec 21, 2021

@jerri Hi there!

If you rebase against master, you may have conflicts to solve. But right now (and back then) it wasn't rebased.

I'm not familiar with how to understand merge commits like c43079c. As you can see it's a few pages long.

https://github.com/tmux-python/tmuxp/pull/672/commits

Do you know how to rebase against master? Can I provide a tutorial maybe?

In other words, it would be just your changes as commits, I'm not sure what to make of the commit with "Merge branch 'master' into issue-139".

@tony
Copy link
Member

tony commented Dec 21, 2021

I remember now. When I asked that question earlier, I was of the belief that GitHub actions tests weren't running because the merge commit(s). Also we recently migrated to GitHub actions.

I suppose GitHub's interface solves a lot of it (I only see the diff) - I'd still prefer having a clean PR. Is that possible? (Not via merge, but git pull --rebase [tmux-python's remote] master

Example of what I mean:

git checkout issue-139
git remote add tmux-python https://github.com/tmux-python/tmuxp.git
git fetch tmux-python
git pull --rebase tmux-python master
Resolve any conflicts that arise
git push --force-with-lease

(Assume the branch issue-139 is already set to target your repo)

@jerri
Copy link
Contributor Author

jerri commented Dec 21, 2021

I see. I will prepare something fresh then.

@tony
Copy link
Member

tony commented Dec 22, 2021

@jerri Sorry about that. Thank you! Take your time.

@tony
Copy link
Member

tony commented Dec 22, 2021

@jerri Also, have you figured out how to write the tests? e.g. test_workspacebuilder.py

That would definitely make the PR easier to merge

@jerri
Copy link
Contributor Author

jerri commented Dec 22, 2021

Sorry, no testing as of now. First I didn't find a fix for the problem that occured at the time. Second I really didn't find time to do any additional implementation.

Had to implement the special case for the first pane. In that case the
shell for the window that is created has to be overridden.

This also fixed a bug (in my opinion) that `window_shell` only affected
the first pane, and none of the other panes in a window.

The system unfortunatelly still bailes out, when the specified shell is
not executable (e.g. doesn't even exist). The problem is an unhandeled
exception when the information for the pane can't be extracted (as it
never really started). Not sure how to catch that and provide a sensible
message to the user.
As the examples.rst files was replaced by the md-files in the main line.
@jerri
Copy link
Contributor Author

jerri commented Dec 22, 2021

OK. Rebase has happened.

@tony
Copy link
Member

tony commented Dec 22, 2021

@jerri Thank you!

@tony
Copy link
Member

tony commented Dec 22, 2021

@jerri I will take a look at if I can add the tests, too

@tony
Copy link
Member

tony commented Jan 8, 2022

@jerri If you give me access to your tmuxp repository, I can also rebase it for you and force push it

@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.

- print('This is python 3')
- shell: /usr/bin/vim -u none
shell_command:
- iAll panes have the `remain-on-exit` setting on.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- iAll panes have the `remain-on-exit` setting on.
- All panes have the `remain-on-exit` setting on.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait. I'm wrong

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆

Copy link
Member

@tony tony Jan 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i... Insert

I've been in vim every day for 15+ years and this got past me

@tony tony merged commit 7b84844 into tmux-python:master Jan 29, 2022
@tony
Copy link
Member

tony commented Jan 29, 2022

@jerri It's in!

@tony
Copy link
Member

tony commented Jan 29, 2022

I will add this into next release, which will hopefully be soon!

@jerri jerri deleted the issue-139 branch January 29, 2022 13:16
@jerri
Copy link
Contributor Author

jerri commented Jan 29, 2022

Awesome. Thanks for the info, and hope it helps. :-D

@tony
Copy link
Member

tony commented Mar 19, 2022

@jerri This is live in tmuxp 1.10

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.

Respawning panes and remain-on-exit
3 participants