Skip to content

Add a config option for which side panel is focused on startup - #5878

Open
alcroito wants to merge 2 commits into
jesseduffield:masterfrom
alcroito:initial-side-panel-config
Open

Add a config option for which side panel is focused on startup#5878
alcroito wants to merge 2 commits into
jesseduffield:masterfrom
alcroito:initial-side-panel-config

Conversation

@alcroito

@alcroito alcroito commented Jul 30, 2026

Copy link
Copy Markdown

PR Description

Adds a new option that allows the user to choose which side panel is
focused when lazygit starts or when switching repositories.

The new option takes the same values as the gui.sidePanels setting.
The default "files" value is kept when the option is not set.

Setting a hidden panel as the value is rejected at config validation
time.

Passing a path filter or a git subcommand still overrides the option.

Full disclosure, I wrote this using AI, but I tested that it works locally.

Closes: #5877

Please check if the PR fulfills these requirements

  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

alcroito added 2 commits July 30, 2026 18:43
The status context is a plain types.Context rather than a list context,
so it can't be returned as an IListContext. Widening the return type
lets a later change resolve the initial context from any side panel
name. The only caller assigns it to a types.Context and does its own
IListContext assertion where it needs one.
Add a new option that allows the user to choose which side panel is
focused when lazygit starts or when switching repositories.

The new option takes the same values as the gui.sidePanels setting.
The default "files" value is kept when the option is not set.

Setting a hidden panel as the value is rejected at config validation
time.

Passing a path filter or a git subcommand still overrides the option.

Closes: jesseduffield#5877
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.

Add option to configure the default focused startup panel

1 participant