Closed romkatv closed 1 year ago
after getting it to work.. i'm seeing difference in the right side prompts.
warp doesn't show the right-side prompts until the command is run. for example, the k8s context.. in iterm, as i start to type any k8s/helm cmds, the context becomes available which is super helpful but in wrap it wont show unless the cmd is run, sort of defeats the purpose. Is there some setting that needs to be updated in warp ?
not sure if this is going help everyone but i had the same problem. updated to latest p10k (1.19.0), did a bunch of stuffs including (CMD-P -> Honor PS1)but nothing worked unless i did exec zsh. warp wont start up with zsh + p10k. So i ended up, uninstalling both p10k & omz and re-did everything (backedup my zshrc). seems to be working fine. simply upgrading p10k and having warp do the stuff seem to be buggy unless you clean up everything and do it fresh.
I will try ;)
@Marcin-91 Did it work for you ? Unfortunately I couldn't make it work. Am I doing something wrong ?
When I try it, I promise to let you know ;)
My p10k prompt in iTerm2
My p10k prompt in Warp
I had to just enable PS1 and restart Warp to get it working. I can see the Clock is missing but everything else seems to appear.
Thanks for collaborating to get this working 👍 🙇 ❤️
i have p10k installed through zinit but new terminals in warp don't use it. running
zsh
will start a new subshell using p10k though – just new warp terminals won't use it. is there setting i'm supposed to configure to support this?I have the same problem. I need to type
exec zsh
to p10k turn on. Can anyone help? Do we need to make some changes in .zshrc file?
EDIT:
CMD-P -> Honor PS1
inside Warp application works!
Outdated Comment below:
@Marcin-91 's answer works , but it should be said that this dissables Warp blocks, which then defeats the purpose of Warp, imo.
I have yet to try a completely fresh install, as mentioned in other comments. Current setup is:
Lastest Warp (v0.2023.06.20.08.04.stable_03
)
zsh 5.9 (x86_64-apple-darwin22.0)
And p10k at 79753faacb6dc511088cb0d136ec438873613932
commit.
What worked for me @Marcin-91 was doing CMD-P -> Honor PS1
! p10k started appearing instantly after that
+1 @claycoleman ty
Yep, as @claycoleman mentioned, the "Honor user's custom prompt" setting must be enabled (this tells Warp to render your shell-specific prompt rather than Warp's native prompt).
Additionally, we have a couple fixes that'll make their way into a release soon: 1) @ajeetdsouza a fix for the right-side prompt rendering issue 2) @hossein-bakhtiari-revolut a fix for the rendering of unicode block chars that will (a) improve the rendering for p10k's "blurred" config and (b) improve vertical alignment. As @romkatv pointed out in an earlier comment, this involves special-casing those chars to be rendered natively rather than with the corresponding font glyphs.
Here's how my p10k prompt is rendered (with a right-side prompt and "blur" selected):
I scrolled through all bug reports here and most of them appear to be fixed on the screenshot in https://github.com/warpdotdev/Warp/issues/2851#issuecomment-1608098245. Great job!
There is still a minor rendering issue.
If you zoom in on the prompt, you'll see black gaps where indicated by the red arrows. Ideally, there should be no gaps in there.
A part of the right prompt is invisible because the terminal is apparently configured with identical hues for background and color 0. It's a good idea to make them distinct at least for the sake of testing. (It's a good idea in general to keep these colors distinct. If they are identical, you have one fewer color to work with as black background becomes indistinguishable from no background. This isn't much different from, say, green color being identical to the background color, which is obviously undesirable.)
Lastly, it's unclear whether the bug report from https://github.com/warpdotdev/Warp/issues/2851#issuecomment-1606233249 has been addressed. You can test it as follows:
POWERLEVEL9K_TIME_SHOW_ON_COMMAND=foo; p10k reload
and press ENTER. Current time should disappear from the right prompt.foo
without pressing ENTER. Current time should appear in the right prompt. If it does not, this indicated that the bug reported by https://github.com/warpdotdev/Warp/issues/2851#issuecomment-1606233249 has not been fixed.Edit: I forgot to mention the bug reported by multiple users that causes the cursor to appear on the wrong line. It's unclear whether it's been fixed on the screenshot in https://github.com/warpdotdev/Warp/issues/2851#issuecomment-1608098245 because that screenshot doesn't show the cursor.
Thanks, everyone - working perfectly for me! I had to remove my previous installation of powerline10k using the instructions here and everything worked. Before that step, it would complain that powerlevel10k was out of date (even though it was freshly updated).
@romkatv In terms of there still being some gaps - the first set of changes for "native" glyph rendering are only targeting Unicode "block drawing" characters, not the "box drawing" characters. Definitely going to add those too, but taking things one step at a time. :)
@zachbai @romkatv everything working nicely at this end:
There's only this extra line where the cursor should be next to the green >
instead of in a new line below.
But nothing serious, really happy it's working :)
The release notes for the latest version indicate that p10k is now supported but it's not loading the theme for me in Warp. The theme does load in iTerm2. I've configured it using oh my zsh. Is there anything specific that needs to be done to enable the theme in Warp?
@gee4vee Have you enabled the 'Honor user's custom prompt' setting per https://github.com/warpdotdev/Warp/issues/2851#issuecomment-1608064909?
@zachbai that's what I was missing! Thanks!
Thanks guys for this awesome work, just found out that the p10k feature to show some context on right side (e.g the k8s current context), dynamically based on what you're typing is not working in Warp. This bug has already been identified in this comment but I did not see any acknowledge or response about this bug. I've followed the steps stated by @romkatv in this comment and the current time never appeared in the right prompt.
This feature working on iterm2 with the exact same zsh/p10k config This feat is great, on my side it's the only blocker left for using Warp
@clemcvlcs @Arvindh-Mojo Unfortunately this is a side-effect of the way the Warp input editor is implemented -- Warp's input doesn't send each individual character to the shell; the full command is submitted to the shell when you press "enter". This means the shell doesn't receive the in-progress input buffer and won't output the dynamic right-prompt as you type. All's to say that this is unlikely to change anytime soon, but we're aware of the underlying issue (this also prevents full support for a tool like fzf, for instance).
Mine seems to put an additional newline at the end:
In iTerm2:
Mine seems to put an additional newline at the end:
In iTerm2:
If you run this exec zsh
, it fixes it for now, hopefully they fix this bug.
@rsalmei @xavieraijon This is actually not a bug per se. Warp renders the prompt on it's own line (indeed different from other terminals). See this screenshot of Warp's native prompt, rendered on the line above the cursor:
We do hear your feedback on the issue though and have a feature request for "same line prompt" that you can follow here: https://github.com/warpdotdev/Warp/issues/2304. There's no firm ETA for this at the moment but it's definitely on the roadmap.
Warp renders the prompt on it's own line
Thanks @zachbai, but why then an exec zsh
does fix it?
EDIT: screenshots included, why does it change the cursor style?
Thank you so much for all the hard work, great to see it working mostly now.
I've gotten around the multi-line input issue by disabling it in p10k, so a workaround until the proper feature is released.
However, now I have the small issue of the command not being next to the arrow when transient prompt is enabled in p10k. Is there any way to resolve this?
@rsalmei running exec zsh
effectively opts-out of Warp's integration, so you're dropped into a "normal" shell experience, at the expense of losing completions, block segmentation, etc. But it also allows the shell to render the prompt itself, which is why it renders on the same line like other more traditional terminal emulators.
@dehan-jl The green arrow in the completed blocks is also a prompt -- so it is subject to the same newline issue.
Query for @romkatv or other p10k/warp gurus here. How inadvisable is it to run two different p10k setups? That is, until #2304 is "fixed," could I:
if [[ $TERM_PROGRAM != "WarpTerminal" ]]; then
[[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh
unset ZLE_RPROMPT_INDENT
source ~/.iterm2_shell_integration.zsh
else
[[ -f ~/.p10k.zsh.oneline ]] && source ~/.p10k.zsh.oneline
fi
where if on Warp, I run a one-line prompt (which is really two lines, but, well, one less line), but in iTerm2 I run my normal two liner?
(And I now realize I should probably add a:
if [[ $TERM_PROGRAM == "iTerm.app" ]]
for that iterm2 integration...)
@mathomp4 Sure, you can do that. You can also add an if
or two to ~/.p10k.zsh
and have just one config. Both approaches are fine.
@mathomp4 Sure, you can do that. You can also add an
if
or two to~/.p10k.zsh
and have just one config. Both approaches are fine.
Well I feel a bit dumb. Just took a look and, yep, there's like two lines different between the two configs. Sigh. 😄
Hello together,
P10K works great so far with the known issues, but i don't know if this issue is allready discussed.
At the right side, when i have insert and executed a command, the Warp options for that command block are hidden behind the right side from P10K.
is there a possibility to fix this ?
When i hover over the buttons they appears above the P10K design.
@Frittenfred97 The buttons show up only when you hover over a block, we implemented a background to the buttons so they won't overlap with the right prompt or very long prompts. This was a bit of a tradeoff we had to make when supporting rprompt so we hope you'll understand. As a workaround, you can use CMD-UP/DOWN
to navigate/highlight the blocks and not trigger the block buttons.
Hi @dehan-jl,
How exactly did you fix that issue in p10k? I'm having the same.
@Scott-J-McMullan so what I ended up doing is setting up two configurations using p10k configure
, one for Warp and one for other terminals. For my Warp configuration, I set the "Prompt Height" option to one line, as Warp effectively injects its own newline. I then set the correct p10k configuration in my .zshrc
by checking if the active terminal is Warp. Hopefully Warp will support multi-line prompts Soon™.
@dehan-jl Nice one, thanks mate
For me the problem is I don't see the features enabled until I run exec zsh
@pmbanugo have you turned on Honor user's custom prompt (PS1)
& set zsh as your startup shell?
This worked perfect, thanks! I didn't need to change the startup shell because my default is zsh.
Hi Everyone, I'm running this version of Warp terminal v0.2023.08.15.08.03.stable_00
and my p10k settings only shows up when i run exec zsh
once entered in to my terminal
and i dont see Honor user's custom prompt
setting in my version,
can someone help me here?
@chandrakanthkannam I think they have moved the setting. Go to Settings > Appearance > Prompt & make sure that Shell prompt (PS1) is selected.
Thanks @Scott-J-McMullan , I was able to get that running now.
Besides dong exec zsh
is there no other way to solve the new line issue? exec zsh
eliminates some of the features of Warp that I want to try out
Hi Everyone, I have issue with Warp + ZSH + p10k rainbow style: like you can see in the screenshot below all my segments separators have a dark background color.
I didnt found any variable config to configure it in p10k.zsh file. Note that it's the same for all segment styles (tangled, angled, rounded) and that Im using Meslo font.
Someone maybe familiar with such issue ?
Thanks.
@kzana Probably #2851 (comment)
Thanks I missed it !
Hello, I noticed that executing a command with a right-side prompt causes it to flicker: it jumps to the very edge of the window, then quickly readjusts its position. Just run any command that will throw a non-zero exit code, then click enter repeatedly. Anybody else facing the same issue?
EDIT Actually, holding enter causes problems as well, p10k control sequences such as ^[i^P enter the terminal input and are being interpreted as actual commands.
Gonna close this out since it's mostly working. We can open up new issues for follow up improvements.
Hi. I just tried to install Warp, coming from iTerm. When using Powerlevel10k, the arrows are colored different than than the block it is coming from, which is really irritating. Is there some way of fixing this?
@Cliffback #2851 (comment)
Thank you! :D
Query for @romkatv or other p10k/warp gurus here. How inadvisable is it to run two different p10k setups? That is, until #2304 is "fixed," could I:
if [[ $TERM_PROGRAM != "WarpTerminal" ]]; then [[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh unset ZLE_RPROMPT_INDENT source ~/.iterm2_shell_integration.zsh else [[ -f ~/.p10k.zsh.oneline ]] && source ~/.p10k.zsh.oneline fi
where if on Warp, I run a one-line prompt (which is really two lines, but, well, one less line), but in iTerm2 I run my normal two liner?
(And I now realize I should probably add a:
if [[ $TERM_PROGRAM == "iTerm.app" ]]
for that iterm2 integration...)
I solved the problem by adding
if [[ $TERM_PROGRAM != "WarpTerminal" ]]; then
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS+=(newline)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS+=(newline)
fi
to the bottom of ~/.p10k.zsh
For my case, I needed to remove Prompt and a new line, so I did this in my .zshrc
to make it compatible between iTerm and Warp using one p10k.zsh
file.
[[ ! -f ~/.p10k.zsh ]] || {
source ~/.p10k.zsh
if [[ $TERM_PROGRAM == "WarpTerminal" ]]; then
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(${POWERLEVEL9K_LEFT_PROMPT_ELEMENTS[1,-3]})
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(${POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS[1,-2]})
fi
}
Warp: iTerm:
After disabling the prompt_char
from the prompt, is there a way to disable it from being printed on each command?
It looks like you've enabled Transient Prompt. You can turn it off via the configuration wizard or by editing ~/.p10k.zsh
: https://github.com/romkatv/powerlevel10k/blob/da9b03777c4f2390c7e3f5c720ee4689336f811b/config/p10k-lean.zsh#L1683
It looks like you've enabled Transient Prompt. You can turn it off via the configuration wizard or by editing
~/.p10k.zsh
: romkatv/powerlevel10k@da9b037
/config/p10k-lean.zsh#L1683
Thanks! Thought there would be something to disable it completely, but this looks good as well.
I'm the author and maintainer of powerlevel10k (a zsh theme). I see in the docs that Warp does not support powerlevel10k. Is there anything I can help you with?
I haven't used Warp but from other terminals with similar capabilities I gather that you need to annotate prompt and the command line with special escape codes. Powerlevel10k has built-in support for popular annotations. The right kind of annotation is enabled automatically based on the terminal (iTerm2, Kitty, VSCode, etc.). I could do the same for Warp but I would need to know what needs annotating. Perhaps you have a specification of the protocol?
Warp Internal (ignore) - linear-label:770f6576-d6c0-4e4f-a259-fc64b5156087