It’d be great to support Warp as one of the options for a Terminal.
+10000
Warp is now my default terminal app, please add it to the options
Making Warp a pickable option would be great.
I did see this thread for Windows and it seems to basically work for Warp as well:
I was able to run my .sh script in Warp and worked as expected. So I guess i you needed to get to the terminal you could add some aliases in your profile that first moves you to the public folder and then runs the correct .sh script to setup the environment??
any others been able to do a work around?
Bob
It would be great if we could see an admin update if this is on the roadmap for potential integration.
I’ve started using Warp and it would much more efficient for my work flow if Local site shell’s could open via Warp.
Hey @matthewfarlymn - thanks for chiming in!
I can update from the engineering team’s perspective - yes, this is on our roadmap! We’re trying to finish up a couple of larger projects before the holidays, but this is in our “Next Up” bucket of smaller things to knock out in downtime over the holidays/to start 2024. It should be coming soon!
Hey all - thanks for being patient with us! As promised, this is included in our first release of 2024, now in Beta
Check it out here! Local Beta 8.2.1
It should be to stable (all users) later this week.
Nice to see that Warp support made it to the release today. However, it is Warp support without “warpifying” the subshell, which kind of misses the point.
This page should give you a sense of what it takes to “warpify” the subshell when it is created: Subshells - Warp Documentation.
Hey @efc – I don’t use Warp so I’m not quite sure the specific nuances of how they make things warpified.
Looking at the relevant documentation:
By default, Warp automatically recognizes the following commands as subshell-compatible:
- bash, fish, zsh
- docker exec
- gcloud compute ssh
- eb ssh
- poetry shell
When you run a command that’s subshell-compatible, Warp will prompt you and invite you to “Warpify” the subshell which makes all of the modern IDE features of Warp available in that subshell. The list of subshell-compatible commands is configurable in Subshell settings as described
– Subshells - Warp Documentation
On Local’s end, the way that a site shell is created is by running a shell script using whatever the terminal is set to. I had a hunch that maybe Warp doesn’t like us using the posix expression of:
exec $SHELL
So I updated how Local generates that script and tried using it to run Warp. While that does seem to “warpify” things (for example, I can use the pound key to generate commands using ai), there seems to be a problem with Warp not respecting the changes that Local’s script makes to the $PATH variable.
For example, in this screen recording, you can see the first attempt with a Warpified terminal does use AI to generate a command, however it can’t find wp
because that command doesn’t exist in my path. The regular, non-warpified terminal doesn’t have AI, however, it does have the correct adjustments to the $PATH variable.
I don’t know what the correct next step is. According to Warp’s documentation, bash, fish, zsh
should work. Technically exec
isn’t one of those, but it is a built-in command for those shells and the way we use it, we are executing a subshell of whatever is set within the $SHELL
variable.
I wonder if someone from Warp would be able to offer more information around what can be done to get things working with the adjustments that Local makes to the $PATH variable left intact?
Hi @ben.turner, thanks for looking into this.
I think Warp is an odd duck. By “warpifying” the shell (or “subshell” in this case, I think), we really mean to give Warp the information it needs to take over the prompt and history of the shell in a way I’ve never seen another terminal attempt. If you look at the details in the subshell documentation Warp provides, you will see that the details of what need to be done also differ based on which shell the user is running. This is probably a level of detail that Local does not really “know” and should not be bothered with.
I know that in my case, running the fish shell in the Warp terminal program, I need to execute the following to get the terminal warpified. Note, all I have to do is paste this code into the shell provided by Local and the shell gets “warpified” and can still execute the search-replace shown in your demo.
if status is-interactive
printf '\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "fish"}}\x9c'
end
But if someone is running zsh or bash they might need a different bit of code to make this work.
So this makes me wonder… does Local allow me to specify a script to run after it has spawned whatever shell it sets up when launching a terminal window? If Local would do that, then I could just put the code I need to warpify Local’s subshell into that script so that it runs every time Local starts a terminal. This may even be something Local allows already, but if it is not, then it might be easier to implement than spending time guessing details of each user’s oddball setup.
In other words, just give us a hook and we can solve this problem pretty easily. This kind of hook might be useful to others for all sorts of reasons, but I do know it could help me resolve the “warpify” problem. (Do I sound like a WordPress developer here? We are always asking for hooks, it seems.)
Note, I am not an expert in shells or the intricacies of terminals. I just know I like how Warp works and would love for it to really be able to do its magic
Local doesn’t have something like this right now, but it’s a great idea! I’d say create a feature request here in this category so that we can see what kind of interest there is and prioritize the work.
Yep! I like the WP model of allowing others to hook into things to make it their own!
Ok, I’ve posted a feature request at Create a hook to run a custom script after launching a site shell, please vote it up if you like it.
Thank you @efc! We’re going to go ahead and close out this request for now. If anyone wants they can follow along on your new post to upvote or comment.