jesseduffield / jesseduffield/lazygit

Allow configuring the flexible split threshold for main panel layout

Open
#5,751 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

### Is your feature request related to a problem? Please describe.
I use a tiling window manager. When lazygit is the only window open, my terminal is 193 columns wide, which is just below the hardcoded 200 column threshold that determines whether the main panel splits horizontally or vertically.

### Describe the solution you'd like
A way to configure the horizontal split threshold.

The current code is:
https://github.com/jesseduffield/lazygit/blob/722239abd1edb756f4d6e65b8b7b0ba05c10011c/pkg/gui/controllers/helpers/window_arrangement_helper.go#L389-L390

Maybe something like this:
```
gui:
mainPanelSplitMode: flexible
mainPanelSplitHorizontalThreshold: 150 # default 200
```

### Describe alternatives you've considered
I tried setting `mainPanelSplitMode: horizontal`, and it works the way i want (horizontal split) when lazygit is the only window open, but if I open another window the terminal halves in width, and I dont want it stay a horizontal split at this smaller width.

Another alternative is for me to use `ctrl + -` to decrease my terminal font size, but I like my current size and don't want to have to decrease it just to meet the hardcoded value.

### Additional context
At 193 columns wide, flexible mode splits vertically even though I'd prefer horizontal so that I can actually see more than a few lines of the diff:
Image

Contributor guide

Open the contributing guide

Research direction

Start at pkg/gui/controllers/helpers/window_arrangement_helper.go around lines 389-390, where the flexible layout uses the hardcoded threshold, and trace how GUI settings are defined and read. Add a configurable horizontal threshold with a default of 200, then verify that flexible mode changes its split at the configured width while retaining the existing behavior by default.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.