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

fix: source _pure_prompt_new_line event handler instead of relying on autoloading #357

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

Conversation

edouard-lopez
Copy link
Member

@edouard-lopez edouard-lopez commented Dec 19, 2024

related: fixes #356

From the doc: https://fishshell.com/docs/current/language.html#event

Please note that event handlers only become active when a function is loaded,
which means you need to otherwise source or execute a function instead of
relying on autoloading.


TODO

  • Fix tests

How to test pre-release?

☠️ Feature can be unstable and break your prompt!

fisher install pure-fish/pure@fix/no-line-spacing-between-prompts-356 # branch name

Specs

Documentation

Event handlers aren't autoloaded, so we need to force loading of the _pure_prompt_new_line handler in the init process.

Acceptance Checks

  • Documentation is up-to-date:
    • Add entry in feature list of README.md ;
    • Add entry in features' overview in docs/ ;
    • Add section in feature list to document
      • Features' flag ;
      • Prompt symbol ;
  • Default are defined in conf.d/pure.fish for:
    • Feature flag ;
    • Symbol ;
  • Tests are passing (I can help you 🤗 ):
  • Customization is available ;
  • Feature is implemented.

… autoloading

From the doc: https://fishshell.com/docs/current/language.html#event
> Please note that event handlers only become active when a function is loaded,
> which means you need to otherwise source or execute a function instead of
> relying on autoloading.

fix #356
@edouard-lopez
Copy link
Member Author

Test are silently failing

# /home/nemo/.config/fish/pure/tests/_pure_init.test.fish
source: Error encountered while sourcing file '/home/nemo/.config/fish/functions/_pure_prompt_new_line.fish':
source: No such file or directory
ok 103 init: _pure_fresh_session
source: Error encountered while sourcing file '/home/nemo/.config/fish/functions/_pure_prompt_new_line.fish':
source: No such file or directory

@edouard-lopez edouard-lopez added the 🐛 bug something that doesn't works as expected label Dec 19, 2024
@parnavh
Copy link

parnavh commented Dec 23, 2024

Seems to do the trick! There is a space now after the output of a command

Although it doesn't have space above the initial prompt, seems to be fine after clear but not right when the terminal is initialized

@edouard-lopez
Copy link
Member Author

I'm using Tmux which might differ from what you have, could you share a screenshot?

@parnavh
Copy link

parnavh commented Dec 29, 2024

space between command works but no space above the initial prompt as there was before:
image

works after clear:
image

terminal: alacritty

@parnavh
Copy link

parnavh commented Jan 15, 2025

Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug something that doesn't works as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No line spacing between prompts
2 participants