Task for Open current file in GitHub #44818
brpaz
started this conversation in
Show and tell
Replies: 1 comment
-
|
@brpaz Thanks for the workaround, buddy. It just works out 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was missing the functionality to open a specific file in GItHub directly from Zed (which is something that is possible in VSCode).
I managed to implement similar functionality using tasks and the GitHub CLI.
{ "label": "GitHub | Open Current File", "command": "gh browse $ZED_RELATIVE_FILE --no-browser | xargs xdg-open", "hide": "always", "cwd": "$ZED_WORKTREE_ROOT", "use_new_terminal": false, "allow_concurrent_runs": true, "reveal": "never", "shell": { "program": "sh" } }, { "label": "GitHub | Open Current File (at line)", "command": "gh browse $ZED_RELATIVE_FILE:$ZED_ROW --no-browser | xargs xdg-open", "hide": "always", "cwd": "$ZED_WORKTREE_ROOT", "use_new_terminal": false, "allow_concurrent_runs": true, "reveal": "never", "shell": { "program": "sh" } }The
--no-browser | xargs xdg-openis a trick to handle the fact that when runningghfrom zed, the console is not a TTY, so browser didn´t open automatically.For MacOS, I believe you can use
openinstead ofxdg-openBeta Was this translation helpful? Give feedback.
All reactions