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

Display error from shell command in popup box same as success #10947

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Lyndon-Mackay
Copy link

@Lyndon-Mackay Lyndon-Mackay commented Jun 14, 2024

Overview

The changes below are to make a popup box appear when the shell has an error in the same manner as a successful run.
Talked about in #7509
The status bar appears to have been improved since the issue was raised I have not seen "async job failed"

Testing

My test example was just typing from normal mode

  • ":sh ls" for the normal case
  • ":sh ls -garbage" for the error case.

Changes

I add a new callback type that returns an anyhow result
Changed the shell callback inner function to use the new callback type when shell output fails.

Alternative approach

My preferred approach is to modify EditorCompositorCallback to return a anyhow result with the rest of the code just returning the ok result.
That approach requires more work so I want to get feedback before I commit to it

Challenges

When callback defined in run_shell_command function returns an error result, it matches the error branch on add which doesn't have access to the editor or Compositor.

@kirawi kirawi added the A-command Area: Commands label Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-command Area: Commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants