Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pkg/app/errors.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package app

import (
"fmt"
"os"
"strings"

"github.com/jesseduffield/lazygit/pkg/i18n"
Expand Down Expand Up @@ -31,6 +33,14 @@ func knownError(tr *i18n.TranslationSet, err error) (string, bool) {
originalError: "getwd: no such file or directory",
newError: tr.WorkingDirectoryDoesNotExist,
},
{
originalError: "terminal entry not found: term not set",
newError: tr.TermNotSet,
},
{
originalError: "$TERM Not Found",
newError: fmt.Sprintf(tr.TermNotFound, os.Getenv("TERM")),
},
}

if mapping, ok := lo.Find(mappings, func(mapping errorMapping) bool {
Expand Down
3 changes: 3 additions & 0 deletions pkg/gui/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,9 @@ func (gui *Gui) initGocui(headless bool, test integrationTypes.IntegrationTest)
Height: height,
})
if err != nil {
if err.Error() == "exit status 1" {
err = errors.New("$TERM Not Found")
}
return nil, err
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/i18n/english.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ type TranslationSet struct {
StashOptions string
NotARepository string
WorkingDirectoryDoesNotExist string
TermNotSet string
TermNotFound string
ScrollLeft string
ScrollRight string
DiscardPatch string
Expand Down Expand Up @@ -1583,6 +1585,8 @@ func EnglishTranslationSet() *TranslationSet {
StashOptions: "Stash options",
NotARepository: "Error: must be run inside a git repository",
WorkingDirectoryDoesNotExist: "Error: the current working directory does not exist",
TermNotSet: "Error: TERM environment variable not set.",
TermNotFound: "Error: could not find terminal info for $TERM '%s'. Please check your TERM variable is set correctly.",
ScrollLeft: "Scroll left",
ScrollRight: "Scroll right",
DiscardPatch: "Discard patch",
Expand Down