Skip to content

Conversation

cattyman919
Copy link

@cattyman919 cattyman919 commented Sep 7, 2025

PR Description

Resolves #4868

The root cause stems from running an external command infocmp in setupterm function from tcell dependency.

func (tc *termcap) setupterm(name string) error {
cmd := exec.Command("infocmp", "-1", name)
output := &bytes.Buffer{}
cmd.Stdout = output
tc.strs = make(map[string]string)
tc.bools = make(map[string]bool)
tc.nums = make(map[string]int)
if err := cmd.Run(); err != nil {
return err
}

The error returns 'exit status 1' which will be propagate all the way up to app.go.

Unset Term Variable

Before

> unset TERM
> lazygit
Not in a git repository. Create a new git repository? (y/N): N
2025/09/07 18:52:22 An error occurred! Please create an issue at: https://github.com/jesseduffield/lazygit/issues

*fmt.wrapError terminal entry not found: term not set
/home/runner/work/lazygit/lazygit/pkg/app/app.go:55 (0xc9d2bf)
/home/runner/work/lazygit/lazygit/pkg/app/entry_point.go:172 (0xc9f486)
/home/runner/work/lazygit/lazygit/main.go:23 (0xca0838)
/opt/hostedtoolcache/go/1.24.5/x64/src/internal/runtime/atomic/types.go:194 (0x443f6b)
/opt/hostedtoolcache/go/1.24.5/x64/src/runtime/asm_amd64.s:1700 (0x480ca1)

After

> unset TERM
> lazygit
Not in a git repository. Create a new git repository? (y/N): N
2025/09/07 20:58:03 Error: TERM environment variable not set.
exit status 1

Invalid Term Variable

Before

> export TERM=skibidi
> lazygit
Not in a git repository. Create a new git repository? (y/N): N
2025/09/07 18:49:56 An error occurred! Please create an issue at: https://github.com/jesseduffield/lazygit/issues

*exec.ExitError exit status 1
/home/runner/work/lazygit/lazygit/pkg/app/app.go:55 (0xc9d2bf)
/home/runner/work/lazygit/lazygit/pkg/app/entry_point.go:172 (0xc9f486)
/home/runner/work/lazygit/lazygit/main.go:23 (0xca0838)
/opt/hostedtoolcache/go/1.24.5/x64/src/internal/runtime/atomic/types.go:194 (0x443f6b)
/opt/hostedtoolcache/go/1.24.5/x64/src/runtime/asm_amd64.s:1700 (0x480ca1)

After

> export TERM=skibidi
> lazygit
2025/09/07 21:00:01 Error: could not find terminal info for $TERM 'skibidi'. Please check your TERM variable is set correctly.
exit status 1

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

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.

I catch an Error exit status 1
1 participant