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

Nushell Support #65

Closed
aemogie opened this issue Sep 4, 2023 · 3 comments · Fixed by #66
Closed

Nushell Support #65

aemogie opened this issue Sep 4, 2023 · 3 comments · Fixed by #66
Assignees
Labels
documentation: user Improvements or additions to documentation for end-users enhancement Improvement of existing feature

Comments

@aemogie
Copy link

aemogie commented Sep 4, 2023

I think this could be integrated into nushell using

$env.config.hooks.pre_prompt = { mommy -1 -s $env.LAST_EXIT_CODE }

I believe this is analogous to the other integrations provided in the README, but there is a problem where it gets printed even for simply hitting enter, or clearing the screen, as it is a prompt hook.

I believe there is a way to integrate this better using display_output (which allows to mutate the output of the previous command itself, or simply print it back with mommy appended to it) and command_not_found (which is run on the occasions display_output isn't, I believe) hooks, but I'm not sure how exactly that would be implemented.

@FWDekker
Copy link
Owner

FWDekker commented Sep 4, 2023

cool!

i'm looking at nushell's defaults right now, and it has the date and time all the way on the right. would it be possible to replace that with mommy's output, similar to how it is integrated in fish?

@FWDekker FWDekker self-assigned this Sep 4, 2023
@FWDekker FWDekker added enhancement Improvement of existing feature documentation: user Improvements or additions to documentation for end-users labels Sep 4, 2023
@aemogie
Copy link
Author

aemogie commented Sep 11, 2023

Couldn't find a default config in nushell source, so I looked at starship. This should work.

$env.PROMPT_COMMAND_RIGHT = {|| mommy -1 -s $env.LAST_EXIT_CODE }

@FWDekker
Copy link
Owner

thanks, @aemogie! i have added it to the readme in #66~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation: user Improvements or additions to documentation for end-users enhancement Improvement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants