From 81d79a7e41648d0bd228f5aac32700bee91553fc Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Tue, 23 Jul 2024 08:33:38 +0200 Subject: [PATCH] docs(blog): reword rprompt text --- website/blog/2024-07-22-bash-rprompt.mdx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/website/blog/2024-07-22-bash-rprompt.mdx b/website/blog/2024-07-22-bash-rprompt.mdx index 4dc92204..be20031d 100644 --- a/website/blog/2024-07-22-bash-rprompt.mdx +++ b/website/blog/2024-07-22-bash-rprompt.mdx @@ -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 @@ -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?