romkatv / powerlevel10k

A Zsh theme
MIT License
46.64k stars 2.19k forks source link

When configuring using `p10k configure`, it will jump directly to 'Show current time?' #2743

Closed FoundAdd closed 3 months ago

FoundAdd commented 3 months ago

I installed zsh and ohmyzsh on Ubuntu Server 22.04, and used xshell to connect to the server via ssh, and then installed p10k according to the installation prompts of powerlevel10k. But when I perform initial configuration and use p10k configure to configure, the program skips the selection of configuration items such as characters and prompts, and jumps directly to the option 'Show current time?' bandicam 2024-08-05 21-28-44-085

What should I do to configure it like in other shells? Is this situation related to the fact that the Ubuntu Server system I am using only has a console but no GUI desktop?

Syphdias commented 3 months ago

Hm, not quite sure if this is the case but might be an issue with tty/interactivity. Could you try forcing a tty with ssh -tt server?

romkatv commented 3 months ago

See https://github.com/romkatv/powerlevel10k?tab=readme-ov-file#some-prompt-styles-are-missing-from-the-configuration-wizard

FoundAdd commented 3 months ago

For @Syphdias

Hm, not quite sure if this is the case but might be an issue with tty/interactivity. Could you try forcing a tty with ssh -tt server?

Since xshell does not seem to support specifying the -tt parameter, I changed the connection tool. In another tool I successfully logged in using ssh -tt server and completed the configuration of the previously mentioned content using p10k configure.

For @romkatv

See https://github.com/romkatv/powerlevel10k?tab=readme-ov-file#some-prompt-styles-are-missing-from-the-configuration-wizard

I read the relevant content pointed to by the URL, and it was verified that there was indeed a problem with the connection tool I was using. When executing print -P '%F{#ff0000}red%f' the result is a very ordinary text content 'red', image

when executing print $terminfo[colors] the result is 8 instead of 256 . image

When I chose another tool, even without using the -tt parameter, I no longer had this problem.

Thanks for your help in finding the cause of this issue!

Syphdias commented 3 months ago

I didn’t realize xshell was not just a terminal emulator but also the ssh client (akin to putty, I guess). The argument -tt is only valid for ssh. From the man page:

-t' Force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty. As I understand that wasn’t even the problem since you were able to do something at all in the wizard.

Also, not sure if that is what you did but don‘t try arguments for one tool with another tool. That can be dangerous!

FoundAdd commented 3 months ago

I didn’t realize xshell was not just a terminal emulator but also the ssh client (akin to putty, I guess). The argument -tt is only valid for ssh. From the man page:

-t' Force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty. As I understand that wasn’t even the problem since you were able to do something at all in the wizard.

Also, not sure if that is what you did but don‘t try arguments for one tool with another tool. That can be dangerous!

Yeah, thanks for the reminder. I just don’t know the cause of this problem. After finding the reason, although xshell does not support specifying the argument -tt, I specified its Terminal Type as xterm-256color, and now it works fine Work.