New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add shell integration script for fish #157291
Conversation
Great work! Small suggestion: I think it would be nice if the fish script was formatted according to fish_indent rules (i.e. spaces instead of tabs). (I noticed this when I copied the script to my dotfiles repo, which has a pre-commit hook). |
@spasche You'll have to take that up with their "Compile & Hygiene" CI task, I'm afraid. |
Ok, I see. Better be consistent with the local style then (and users won't need to copy the script in their dotfiles once this is merged). For the CI hygiene copyright failure, you may want to add an exclusion for Line 136 in 9395d5e
|
This appears consistent with the treatment of other shell scripts.
@spasche Looks like that worked to appease the CI! Thanks for the tip! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code --locate-shell-integration-path fish to assist manual installation
I believe I added this correctly, but I don't have the ability to build and test it myself on this machine.
I'll queue up a product build to test now 👍
Automatic injection without manual installation
This might be over my head, tbh.
This is fine, I wasn't expecting you to do this as it got pretty complicated for each shell we attempted this on.
Command navigation for multi-line commands
No need to do this, I'm marking the continuation and right prompt sequences as non-final (#157571) and they may end up getting removed. If 633 E
is sent they don't do anything currently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for doing this, just a few comments
src/vs/workbench/contrib/terminal/browser/media/shellIntegration-fish.fish
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/terminal/browser/media/shellIntegration-fish.fish
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/terminal/browser/media/shellIntegration-fish.fish
Outdated
Show resolved
Hide resolved
src/vs/workbench/contrib/terminal/browser/media/shellIntegration-fish.fish
Outdated
Show resolved
Hide resolved
function __vsc_cmd_finished --on-event fish_postexec | ||
__vsc_esc D $status | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to have been addressed by adding __vsc_cmd_clear
hooked into the fish_cancel
event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zgracem This doesn't seem to be completely resolved. This is zsh:
And this is with Fish script from this PR:
As you can see the fish_cancel
event is only fired for Ctrl+C but not when the commandline is empty, which only triggers a fish_prompt
event. My plugin added a extra check for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kidonng nice observation, do you want to send a PR since it's your solution? I can fix it up otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm glad to!
I looked into automatic injection, it seemed like it was going to be easy but I couldn't figure out why "fish si": {
"path": "/usr/local/bin/fish",
"args": [
"-C",
"echo hello world"
]
} See how only "inner shell", not "first fish" appears below: |
…h-shell-integration
Per the changes in #157571.
@Tyriar I can't seem to reproduce the problem you're having with |
Should have been part of 90a258a.
@zgracem weird, could this be related to some config you have? Mine was empty |
The CLI worked, just the file wasn't included in the product build which should be fixed with 327773c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! This should be available in Insiders the day after it's merged 🚀
I'll write up the install section on the website now
add shell integration script for fish
Partially addresses #139400.
How to test
Add the following to the end of
$__fish_config_dir/config.fish
, modifying the value ofVSCODE
appropriately for your system:What works
What needs testing
code --locate-shell-integration-path fish
to assist manual installationWhat doesn't work yet
What I haven't figured out
PS2
; it simply indents incomplete multi-line commands, which behaviour cannot be reconfigured to injectContinuationStart
orContinuationEnd
sequences. There is an open issue to add such functionality, however: Equivalent of PS2? fish-shell/fish-shell#3382.