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

Provide a prompt hook in bin/ysh #498

Closed
andychu opened this issue Oct 2, 2019 · 4 comments
Closed

Provide a prompt hook in bin/ysh #498

andychu opened this issue Oct 2, 2019 · 4 comments

Comments

@andychu
Copy link
Contributor

andychu commented Oct 2, 2019

There will be some way to reuse a PS1 string, but we want something better for Oil

https://oilshell.zulipchat.com/#narrow/stream/121540-oil-discuss/topic/Setting.20the.20prompt.20in.20Oil

@andychu
Copy link
Contributor Author

andychu commented Oct 2, 2019

some variables you might want to consider making available for the prompt are a $PWD (the entire path: /home/user/foo, not sure which shells), $SWD (simplified path: ~/foo, seen in Ion) , and $MWD (minimized path: /h/u/foo, seen in Fish)

@andychu
Copy link
Contributor Author

andychu commented Feb 5, 2021

#619 is related

@andychu
Copy link
Contributor Author

andychu commented May 25, 2021

#799 for fast command sub is related.

Since the initial version of Oil won't have func, I think we can have:

proc render-prompt(:out) {
  setref out = '> '

  # But this is also more likely

   setref out = ${.myprompt}
}

proc myprompt() {
  echo '> '
}

@andychu andychu changed the title Provide a prompt hook in bin/oil Provide a prompt hook in bin/ysh Oct 25, 2023
andychu pushed a commit that referenced this issue Nov 28, 2023
Working on renderPrompt()

Part of issue #498
andychu pushed a commit that referenced this issue Nov 29, 2023
Document the renderPrompt() hook.

This is part of #498.
@andychu
Copy link
Contributor Author

andychu commented Jan 17, 2024

Fixed awhile ago, late announcement - https://www.oilshell.org/blog/2024/01/release-0.19.0.html

@andychu andychu closed this as completed Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant