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

Builder: Use shutil.get_terminal_size() #926

Merged
merged 10 commits into from Apr 7, 2024
Merged

Builder: Use shutil.get_terminal_size() #926

merged 10 commits into from Apr 7, 2024

Conversation

tony
Copy link
Member

@tony tony commented Apr 7, 2024

in re: #667, #704, #737

Warning

This would definitely be breaking behavior.

Test instructions

Latest (1.46.0a0):

pipx install --suffix=@builder-sizes 'tmuxp >= 1.46.0a0'

Outdated:

pipx install --suffix=@builder-sizes 'tmuxp @ git+https://github.com/tmux-python/tmuxp.git@builder-sizes'

Then:

tmuxp@builder-sizes load ./path/to/file.yaml

In the configuration, use options.main-pane-height / options.main-pane-width with or without percentage:

session_name: main-pane-height
start_directory: "~"
windows:
  - layout: main-horizontal
    options:
      main-pane-height: 67%
    panes:
      - shell_command:
          - pane
        start_directory: "~"
      - shell_command:
          - echo "hey"
      - shell_command:
          - echo "moo"
    window_name: my window name

You should see something like:

image

Video:

2024-04-07.12-38-33.-.tmuxp.-.pr.926.-.main-pane-height.mp4

Changes

[Builder] Use shutil.get_terminal_size

This ensures the tmux builder obeys the terminal window's current dimensions.

CLI[Load] Remove layout hooks

These did not seem to be implemented correctly anyway, so will effectively be a noop.

Copy link

codecov bot commented Apr 7, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 70.19%. Comparing base (f4b392c) to head (cd5d114).

Files Patch % Lines
src/tmuxp/workspace/builder.py 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #926      +/-   ##
==========================================
- Coverage   70.28%   70.19%   -0.09%     
==========================================
  Files          26       26              
  Lines        1955     1936      -19     
  Branches      409      404       -5     
==========================================
- Hits         1374     1359      -15     
  Misses        454      454              
+ Partials      127      123       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tony tony merged commit 913ca89 into master Apr 7, 2024
18 checks passed
tony added a commit that referenced this pull request Apr 7, 2024
@tony tony deleted the builder-sizes branch April 7, 2024 22:42
tony added a commit that referenced this pull request Apr 13, 2024
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

1 participant