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.28k stars 337 forks source link

Command syntax highlighting missing (using rtx) #3772

Open AlecRust opened 8 months ago

AlecRust commented 8 months ago

Discord username (optional)

No response

Describe the bug

Warp's "Syntax highlighting for commands" feature seems to not kick in, in all cases it should do.

I install my runtimes (Go, Node, Python and Ruby) using rtx but the command highlighting only works for some of them. See screenshots for examples.

All the binaries are stored in a similar place e.g. /Users/alec/.local/share/rtx/installs/go/1.21.3/go/bin/go so I'm not sure why some work and others don't.

To reproduce

I'm not sure how many others are having this issue, or if it's related to rtx usage or my other Zsh plugins. But my shell setup is very simple and public in my dotfiles repo. Files of note are:

Expected behavior

I expect Warp's "Syntax highlighting for commands" feature to consistently highlight any binary/alias etc. in green.

I don't remember having such issues when I used zsh-syntax-highlighting to provide this feature.

Screenshots

Go (broken)

go

Node (broken)

node

Python (partially broken)

python

Ruby (works)

ruby

Operating system

MacOS

Operating system and version

Sonoma 14.0

Shell Version

No response

Current Warp version

No response

Regression

No, this bug or issue has existed throughout my experience using Warp

Recent working Warp date

No response

Additional context

No response

Does this block you from using Warp daily?

No

Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)

N/A, the issue only applies to a Warp specific feature. (i.e. Warp AI, Workflows)

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

None

dannyneira commented 8 months ago

@AlecRust Sorry to hear about this, are you by any chance seeing the same issues when you install with Homebrew? I wonder if the rtx install method isn't being recognized.

Also please see our list of supported completions, some of the ones you use may not be supported. https://docs.warp.dev/features/command-completions/completions#supported-completion-specs

AlecRust commented 8 months ago

Thanks for your response @dannyneira

I decided to test this with Go. I uninstalled the Go version I had installed with rtx, and installed it with Homebrew.

After a restart of Warp, this does seem to have fixed the issue:

go

So it seems Warp is capable of highlighting the Homebrew installed Go, located at:

image

But Warp is not capable of highlighting rtx installed Go, located at:

image

Warp does seem capable of highlighting rtx installed Ruby though, located in a similar place:

image

Also please see our list of supported completions, some of the ones you use may not be supported.

The only example command in my original post not listed here is bundler which Warp seems to highlight correctly 🙂

rocket-squirrel commented 3 months ago

I too use "rtx" (now "mise") and here's some more context. It's likely caused by how rtx/mise "activates" (preferred installation option from mise website), and on the Warp's part - how/when the PATH is read:

mise activate does not use shims and instead updates PATH so that it doesn't have any overhead when simply calling binaries.

In the examples above "ruby" and "python3" are shown as working. Yes, MacOS has those installed by default. So Warp actually finds their default location before .zshrc is executed and before mise is activated. Here I deleted python previously installed by mise:

which python3
/usr/bin/python3

I have rust installed with mise and if I type "cargo" Warp underlines it as command not recognized. However, if I "warpify subshell" --- then Warp properly highlights "cargo" and offers completion (screenshot attached). I suppose this happens because at the time subshell is "waprified" it's done from environment where mise already updated the PATH.

Screenshot 2024-03-23 at 4 11 13 PM