warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
20.86k stars 355 forks source link

Prompt in one line / Cursor in the same line with the prompt #2304

Closed AMATEURTOSS closed 1 month ago

AMATEURTOSS commented 1 year ago

[WARP] Note to all users opening this issue:


is there any option to make prompt in one line?

current behavior

~/some/location
something command -option

one line prompt

~/some/location > something command -option

How important is this feature to you?

1 (Not too important)

Advait-M commented 1 month ago

Need some docs on how to restore the newline when using Starship. #765 has regressed basically

Just add the following to your starship.toml configuration file.

[line_break]
disabled = false

Yep exactly - this should work on the Starship side!

It's also included in our SLP onboarding block when you update, if you're updating with Starship and Bash (for other shells, we have relevant commands to help you add a newline too!)

image

scullionw commented 1 month ago

if it seems like the suggested starship line_break.disabled = false doesn't work to restore the previous warp behaviour, it is because

[character]
disabled = true
Advait-M commented 1 month ago

if it seems like the suggested starship line_break.disabled = false doesn't work to restore the previous warp behaviour, it is because

[character]
disabled = true

Ah this sounds like the same bug faced here: https://github.com/warpdotdev/Warp/issues/5052#issuecomment-2187031645

Unfortunately, I believe that's an issue on the Starship side ðŸ˜Ē. I don't think I see an issue filed by @onecrayon yet, so it might be worth filing at https://github.com/starship/starship/issues 👀

daUnknownCoder commented 1 month ago

@Advait-M check this right side frame: image

so #3358 isnt solved yet

alokedesai commented 1 month ago

@daUnknownCoder Could you add more details to #3358 with what exactly is broken with tide? I'd like to keep this issue focused on rendering prompts in a single line.

Side-by-side pictures of Warp and another terminal would especially be useful, it's not clear to me from your picture what's broken. Thanks!

Integralist commented 1 month ago

If anyone has any Starship guidance for this https://github.com/warpdotdev/Warp/issues/5052#issuecomment-2225696652 then I'd appreciate your help 🙇ðŸŧ

kankunnawat commented 1 month ago

I want to keep new line for prompt in PS1 but it's not in warp setting option. I tried setting line_break disabled to false but the prompt still single line. Here's my starship.toml for more context

# ~/.config/starship.toml

add_newline = true
command_timeout = 1000
format = """$os$username$hostname$kubernetes$directory$git_branch$git_status"""

# Drop ugly default prompt characters
[character]
success_symbol = ''
error_symbol = ''

# ---

[os]
format = '[$symbol](bold white) '
disabled = false

[os.symbols]
Windows = ' '
Arch = 'ó°Ģ‡'
Ubuntu = ''
Macos = 'ó°€ĩ'

# ---y

# Shows the username
[username]
style_user = 'white bold'
style_root = 'black bold'
format = '[$user]($style) '
disabled = true
show_always = true

# Shows the hostname
[hostname]
ssh_only = false
format = 'on [$hostname](bold yellow) '
disabled = true

# Shows current directory
[directory]
truncation_length = 2
truncation_symbol = 'â€Ķ/'
home_symbol = '󰋜 ~'
read_only_style = '197'
read_only = ' ï€Ģ '
format = 'at [$path]($style)[$read_only]($read_only_style) '

# Shows current git branch
[git_branch]
symbol = ' '
format = 'via [$symbol$branch]($style)'
# truncation_length = 4
truncation_symbol = 'â€Ķ/'
style = 'bold green'

# Shows current git status
[git_status]
format = '[$all_status$ahead_behind]($style) '
style = 'bold green'
conflicted = 'ðŸģ'
up_to_date = ''
untracked = 'ï”Đ '
ahead = '⇡${count}'
diverged = '⇕⇡${ahead_count}â‡Ģ${behind_count}'
behind = 'â‡Ģ${count}'
stashed = 'ïĢ– '
modified = ' '
staged = '[++\($count\)](green)'
renamed = 'ïŠķ '
deleted = ' '

# Shows kubernetes context and namespace
[kubernetes]
format = 'via [óąƒū $context\($namespace\)](bold purple) '
disabled = false

# ---

[vagrant]
disabled = true

[docker_context]
disabled = true

[helm]
disabled = true

[python]
disabled = true

[nodejs]
disabled = true

[ruby]
disabled = true

[terraform]
disabled = true

[line_break]
disabled = false
Advait-M commented 1 month ago

I want to keep new line for prompt in PS1 but it's not in warp setting option. I tried setting line_break disabled to false but the prompt still single line. Here's my starship.toml for more context

@kankunnawat could you please take a look at https://github.com/warpdotdev/Warp/issues/5052? Wondering if anything there might help with this. Are you on Zsh/Bash/Fish? If on Zsh/Fish, you can do this at the rcfiles level too (the command for this should've popped up in an SLP onboarding block when you updated Warp)!

kankunnawat commented 1 month ago

@Advait-M I'm on Zsh. Just check on that issue and adding this PROMPT="${PROMPT}"$'\n' at the end of my .zshrc file solve the problem for me. Appreciate the help! 🙏ðŸŧ https://github.com/warpdotdev/Warp/issues/5052#issuecomment-2225843500

Ps. Wonder if i could config the line height for terminal, currently it looks too dense between pwd and cmd prompt. I try adding another \n but it's too much.

image
ashebanow commented 1 month ago

Just wanted to give a shout-out to everyone at Warp and especially Advait for getting this feature out. It makes me very happy!

Advait-M commented 1 month ago

@Advait-M I'm on Zsh. Just check on that issue and adding this PROMPT="${PROMPT}"$'\n' at the end of my .zshrc file solve the problem for me. Appreciate the help! 🙏ðŸŧ #5052 (comment)

Ps. Wonder if i could config the line height for terminal, currently it looks too dense between pwd and cmd prompt. I try adding another \n but it's too much.

image

Glad to hear that helped @kankunnawat! 😄 Re line height: hmm, have you tried editing Line Height in Warp Settings > Appearance? Though, this will affect the line height for all lines, not just the first one 👀. But perhaps something like 1.4 (compared to our default of 1.2) might be a good setup?

Just wanted to give a shout-out to everyone at Warp and especially Advait for getting this feature out. It makes me very happy!

Thank you for the kind words @ashebanow âĪïļ, glad to hear you're liking it - this comment made me very happy 😛 !

kankunnawat commented 1 month ago

that works perfectly! Thanks for your help really appreciate. @Advait-M

Advait-M commented 1 month ago

Howdy folks! We just launched a video interview + blog that goes into a technical deep dive of why this feature took 11 months to build 🙃 . Thought that folks here might be very interested in this 👀. Feel free to follow up with technical questions for me on YouTube or Twitter! 😄

Like, comment, and subscribe (of course) 😛!