Ji4n1ng/OpenInTerminal

Support for Warp

TopAlien opened this issue ยท 10 comments

I tried "defaults write wang.jianing.app.OpenInTerminal-Lite LiteDefaultTerminal Warp", OpenInTerminal-Lite can open Warp, but it doesn't support "Open in current directory", Warp always open the path when it last closed.
I have no idea it is a bug of OpenInTerminal or Warp.

I tried "defaults write wang.jianing.app.OpenInTerminal-Lite LiteDefaultTerminal Warp", OpenInTerminal-Lite can open Warp, but it doesn't support "Open in current directory", Warp always open the path when it last closed.
I have no idea it is a bug of OpenInTerminal or Warp.

This is not a bug but a feature that needs to be implemented on both sides of Warp and OpenInTerminal.

OpenInTerminal uses an open -a terminal command to open the "not officially supported" terminals1. But an ./path/to/directory argument needs to be added to the command so the terminal would open in the wanted directory. And it will not work instantly because for now, Warp does not support the use of the ./path/to/directory argument to launch the terminal with the directory open. (warpdotdev/Warp#612)

Footnotes

  1. https://github.com/Ji4n1ng/OpenInTerminal/blob/eed23120e02476ec9295ff8b1ab242b8ddd03ada/OpenInTerminalCore/ScriptManager.swift#L25 โ†ฉ

/cc @Ji4n1ng

In a documentation of Warp, they said that the "Open in IDE" feature is implemented, and it is working. But I could not figure out how VSCode starts up a new terminal. So maybe this should be checked.

P.S. This function is NOT always working, sometimes Warp still starts up on the working directory, sometimes ~. By comparison, iTerm starts always on the working directory.
P.P.S. I cannot get it to work with JetBrains IDEs (IntelliJ IDEA).


Update: I'm trying to get some help about the problem above from the Warp team and I did not receive a response yet. I will update this again after I got an answer about what is happening with this feature.

I use "defaults write wang.jianing.app.OpenInTerminal-Lite LiteDefaultTerminal warp" to work normally.

vnl commented

@molvqingtai This worked partially for me, as, It opens two instances. One in root and the other in the current directory as it should.

davay commented

2 weeks ago Warp added public URIs warpdotdev/Warp#612, might take a crack at it

bc-m commented

Workaround

Add this line to your .zshrc' or .bashrc' file, after the lines starting with export PATH:

[ "$TERM_PROGRAM" "==" "Apple_Terminal" ] && open -a Warp.app . && killall Terminal

This is supported in v2.3.7.

@molvqingtai Thanks for the config command. I have one following issue, It opens warp new session in existing window as a new tab. How can I tell it to open new window instead? This is because I use multiple spaces on mac and when I open warp from space 1 and my another warp is open in space 3 then it redirects me to space 3 upon click.

It seems that Warp is still not supported by the -lite version, although README says otherwise