-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
Lazygit allows the user to switch between three 'screen modes' (normal, half, and fullscreen) by pressing the plus ('+') or underscore ('_') keys. And if a repository includes a git submodule, the user can navigate in lazygit from the original repo to the submodule, and view the submodule as if it were a separate repo (but can still return to the original repo by pressing the escape key). However, if one changes the screen mode prior to viewing a submodule, the screen mode is not preserved in the submodule's view.
To Reproduce
Choose a git repository containing a submodule and open it in lazygit.
> cd myrepo
> lazygitPress the plus key ('+') to change the screen mode. If currently in normal, this should change the screen mode to half. Now press two ('2') to focus on the files section, then press left square bracket ('[') to navigate to the submodules tab, and press enter to view the submodule.
The display should change to view the submodule, but now the screen mode is reset to its state before pressing the plus ('+') key. Now press the escape key. The display should change back to the submodule tab in the original repo, but back with the screen mode we selected.
Expected behaviour
I would expect the current screen mode to be preserved when navigating in and out of these submodules from the 'parent' repo. The screen mode automatically switching when navigating in and out of submodules can be slightly jarring. This is in comparison to navigating to a different repo, where I can see some utility in resetting the screen mode since you're less likely to switch back. While with submodules, I can sometimes be frequently switching back and forth between a submodule and its parent repo.
Though if this behaviour of having separate screen modes per submodule is intended/desired, I would propose perhaps adding a configuration setting which controls this behaviour. This way, users can toggle between having separate screen modes and preserving their current screen mode when navigating in and out of submodules.
Screenshots
In the submodules tab of a repo. Currently in half screen mode.

After viewing the selected submodule. Now in normal screen mode.

Platform and version info
Debian GNU/Linux 13 (trixie)
Linux 6.12.57 for x86_64
lazygit 0.57.0
git 2.47.3
Raw output:
> uname --all
Linux McDaDebianPC 6.12.57+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.57-1 (2025-11-05) x86_64 GNU/Linux
> lazygit --version
commit=17d03ec8cb89d4c65fd129228164562a220abefb, build date=2025-12-06T13:01:50Z, build source=binaryRelease, version=0.57.0, os=linux, arch=amd64, git version=2.47.3
> git --version
git version 2.47.3