Skip to content

Commit

Permalink
docs(blog): reword rprompt text
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Jul 23, 2024
1 parent dd74429 commit 81d79a7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions website/blog/2024-07-22-bash-rprompt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ CLI call, so we could control the output more easily. It leveraged the use of th
is a hook that is executed before the prompt is printed. We would first print the [`rprompt`][rprompt] in the `PROMPT_COMMAND`,
and then set the primary prompt in the `PS1` variable so bash would not bother about the [`rprompt`][rprompt] being there.

This approach was a lot **cleaner from an achitectural point of view**, but it had some downsides.
The biggest downside was needing two CLI calls to print the prompt, which is not a big issue,
but it was a bit slower than the first implementation.
This approach was a lot **cleaner from an achitectural point of view**, but it came with its own challenges.
The most obvious one is needing two CLI calls to print the prompt, which made rendering a bit slower than the first implementation.

Additionally, as we print before `PS1` is evaluated, it introduced the following issues:
Additionally, as we print before `PS1` is evaluated, we noticed the following issues along the way:

1. when the output of the previous command didn't end with a newline, the [`rprompt`][rprompt] would be printed on the same line
as the output of the previous command
Expand All @@ -61,13 +60,13 @@ Additionally, as we print before `PS1` is evaluated, it introduced the following
3. depending on the platform, it would still break command history navigation
4. it required different logic for multiline prompts as we print before `PS1` and need to reposition the cursor correctly

Of these issues, **only bullet 4 could be fixed**. Everything else was out of our control.
Of these issues, **only bullet 4 could be fixed**. Everything else was outside of our control.

## Conclusion

Oh My Posh is a tool that needs to be easy to use, maintain and be 100% reliable. One of the core principles of Oh My Posh is that it should
**never break the shell**. The [`rprompt`][rprompt] feature in bash has never been reliable enough, and it was _hard to debug_ when it broke.
I have spent countless hours debugging issues with the [`rprompt`][rprompt] in bash, but it's **time to move on**. If you
I spent countless hours debugging issues with the [`rprompt`][rprompt] in bash, but it's **time to move on**. If you
want to use the [`rprompt`][rprompt] feature, I would recommend using a shell that supports it natively, like [nushell], [zsh] or [fish].

## What about Powershell?
Expand Down

0 comments on commit 81d79a7

Please sign in to comment.