Skip to content

Fixes to duplicate lazygits #225

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

Merged
merged 4 commits into from
Jun 21, 2025
Merged

Fixes to duplicate lazygits #225

merged 4 commits into from
Jun 21, 2025

Conversation

mikavilpas
Copy link
Owner

fix: starting duplicate lazygits

Issue:

In some cases, when snacks is used to start a new lazygit, it will start
a new instance even if one is already open. This can result in multiple
lazygits being open for the same repository, wasting resources.

Solution:

Avoid doing this by caching the lazygits that are known to tsugit. In
addition:

  • improve visibility of what is going on when developing and testing
    with a debug mode

  • allow a repoLevelLazygit and a fileLevelLazygit to coexist. This
    resolves the following issue: when a fileLevelLazygit
    (toggle_for_file()) is started for the repository, and toggled off
    (hidden), it would remain open in the background. Now, when the
    fileLevelLazygit is toggled off, it will be hidden, and when it's
    closed, it will be closed permanently (exited and not restarted).

    The idea is to have a repolevelLazygit that is always open for the
    repository, and a fileLevelLazygit that is opened for a specific file
    for a short time inspection.

fix: possibly reopening file history lazygit 999 times

The typical use case is to only open it temporarily and have the repo
level lazygit open for a long time.

chore: rebuild the tui-sandbox codegen

dependabot bot and others added 4 commits June 18, 2025 12:31
… with 5 updates

Bumps the npm-dependencies group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@tui-sandbox/library](https://github.com/mikavilpas/tui-sandbox) | `10.3.0` | `10.6.0` |
| [cypress](https://github.com/cypress-io/cypress) | `14.4.1` | `14.5.0` |
| [eslint](https://github.com/eslint/eslint) | `9.28.0` | `9.29.0` |
| [tsx](https://github.com/privatenumber/tsx) | `4.20.1` | `4.20.3` |
| [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) | `8.34.0` | `8.34.1` |

Bumps the npm-dependencies group with 5 updates in the /integration-tests directory:

| Package | From | To |
| --- | --- | --- |
| [@tui-sandbox/library](https://github.com/mikavilpas/tui-sandbox) | `10.3.0` | `10.6.0` |
| [cypress](https://github.com/cypress-io/cypress) | `14.4.1` | `14.5.0` |
| [eslint](https://github.com/eslint/eslint) | `9.28.0` | `9.29.0` |
| [tsx](https://github.com/privatenumber/tsx) | `4.20.1` | `4.20.3` |
| [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) | `8.34.0` | `8.34.1` |



Updates `@tui-sandbox/library` from 10.3.0 to 10.6.0
- [Release notes](https://github.com/mikavilpas/tui-sandbox/releases)
- [Changelog](https://github.com/mikavilpas/tui-sandbox/blob/main/release-please-config.json)
- [Commits](mikavilpas/tui-sandbox@library-v10.3.0...library-v10.6.0)

Updates `cypress` from 14.4.1 to 14.5.0
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md)
- [Commits](cypress-io/cypress@v14.4.1...v14.5.0)

Updates `eslint` from 9.28.0 to 9.29.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v9.28.0...v9.29.0)

Updates `tsx` from 4.20.1 to 4.20.3
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](privatenumber/tsx@v4.20.1...v4.20.3)

Updates `typescript-eslint` from 8.34.0 to 8.34.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.34.1/packages/typescript-eslint)

Updates `@tui-sandbox/library` from 10.3.0 to 10.6.0
- [Release notes](https://github.com/mikavilpas/tui-sandbox/releases)
- [Changelog](https://github.com/mikavilpas/tui-sandbox/blob/main/release-please-config.json)
- [Commits](mikavilpas/tui-sandbox@library-v10.3.0...library-v10.6.0)

Updates `cypress` from 14.4.1 to 14.5.0
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md)
- [Commits](cypress-io/cypress@v14.4.1...v14.5.0)

Updates `eslint` from 9.28.0 to 9.29.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v9.28.0...v9.29.0)

Updates `tsx` from 4.20.1 to 4.20.3
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](privatenumber/tsx@v4.20.1...v4.20.3)

Updates `typescript-eslint` from 8.34.0 to 8.34.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.34.1/packages/typescript-eslint)

Updates `@tui-sandbox/library` from 10.3.0 to 10.6.0
- [Release notes](https://github.com/mikavilpas/tui-sandbox/releases)
- [Changelog](https://github.com/mikavilpas/tui-sandbox/blob/main/release-please-config.json)
- [Commits](mikavilpas/tui-sandbox@library-v10.3.0...library-v10.6.0)

Updates `cypress` from 14.4.1 to 14.5.0
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md)
- [Commits](cypress-io/cypress@v14.4.1...v14.5.0)

Updates `eslint` from 9.28.0 to 9.29.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v9.28.0...v9.29.0)

Updates `tsx` from 4.20.1 to 4.20.3
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](privatenumber/tsx@v4.20.1...v4.20.3)

Updates `typescript-eslint` from 8.34.0 to 8.34.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.34.1/packages/typescript-eslint)

Updates `@tui-sandbox/library` from 10.3.0 to 10.6.0
- [Release notes](https://github.com/mikavilpas/tui-sandbox/releases)
- [Changelog](https://github.com/mikavilpas/tui-sandbox/blob/main/release-please-config.json)
- [Commits](mikavilpas/tui-sandbox@library-v10.3.0...library-v10.6.0)

Updates `cypress` from 14.4.1 to 14.5.0
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md)
- [Commits](cypress-io/cypress@v14.4.1...v14.5.0)

Updates `eslint` from 9.28.0 to 9.29.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v9.28.0...v9.29.0)

Updates `tsx` from 4.20.1 to 4.20.3
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](privatenumber/tsx@v4.20.1...v4.20.3)

Updates `typescript-eslint` from 8.34.0 to 8.34.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.34.1/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: "@tui-sandbox/library"
  dependency-version: 10.6.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: cypress
  dependency-version: 14.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: eslint
  dependency-version: 9.29.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: tsx
  dependency-version: 4.20.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: typescript-eslint
  dependency-version: 8.34.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: "@tui-sandbox/library"
  dependency-version: 10.6.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: cypress
  dependency-version: 14.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: eslint
  dependency-version: 9.29.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: tsx
  dependency-version: 4.20.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: typescript-eslint
  dependency-version: 8.34.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: "@tui-sandbox/library"
  dependency-version: 10.6.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: cypress
  dependency-version: 14.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: eslint
  dependency-version: 9.29.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: tsx
  dependency-version: 4.20.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: typescript-eslint
  dependency-version: 8.34.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: "@tui-sandbox/library"
  dependency-version: 10.6.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: cypress
  dependency-version: 14.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: eslint
  dependency-version: 9.29.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-dependencies
- dependency-name: tsx
  dependency-version: 4.20.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
- dependency-name: typescript-eslint
  dependency-version: 8.34.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
The typical use case is to only open it temporarily and have the repo
level lazygit open for a long time.
**Issue:**

In some cases, when snacks is used to start a new lazygit, it will start
a new instance even if one is already open. This can result in multiple
lazygits being open for the same repository, wasting resources.

**Solution:**

Avoid doing this by caching the lazygits that are known to tsugit. In
addition:

- improve visibility of what is going on when developing and testing
  with a debug mode
- allow a repoLevelLazygit and a fileLevelLazygit to coexist. This
  resolves the following issue: when a fileLevelLazygit
  (`toggle_for_file()`) is started for the repository, and toggled off
  (hidden), it would remain open in the background. Now, when the
  fileLevelLazygit is toggled off, it will be hidden, and when it's
  closed, it will be closed permanently (exited and not restarted).

  The idea is to have a repolevelLazygit that is always open for the
  repository, and a fileLevelLazygit that is opened for a specific file
  for a short time inspection.
@mikavilpas
Copy link
Owner Author

There are currently issues in my github account that cause actions for my repositories to not run. I have contacted their support, and am waiting for them to resolve the issue.

I'm merging this in for now since this repository is not popular, and will handle fixing the CI build at a later time, once the actions have been restored.

@mikavilpas mikavilpas merged commit e0ab30b into main Jun 21, 2025
0 of 11 checks passed
@mikavilpas mikavilpas deleted the duplicates branch June 21, 2025 15:24
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.

1 participant