Skip to content
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

fixes #716 Improve missing terminal error message. #717

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

spearson78
Copy link

When running in debug mode in VS Code under Linux the Application.Run() method returns an *os/exec.ExitError . This is very confusing and makes tracking down the root cause difficult.

The issue is caused by the default debug environment in VS Code not launching in a terminal.

The error message can be improved by returning an ErrTermNotFound in the case of an empty $TERM environment variable. Hopefully a better error message will lead users to identify the lack of a terminal as the root cause of the problem.

@spearson78
Copy link
Author

I am willing to either further improve the error message or the project documentation to help users avoid this issue in the future.

terms_dynamic.go Outdated
@@ -30,6 +30,9 @@ import (
)

func loadDynamicTerminfo(term string) (*terminfo.Terminfo, error) {
if term == "" {
return nil, ErrTermNotFound

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe wrap this with "term not set" or something like that?

return nil, fmt.Errorf("%w: term not set",ErrTermNotFound)

that could make it even easier to debug.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made the requested change to the pull request.

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.

None yet

2 participants