Skip to content
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

Custom Tasks launching fish script does not execute preexec --on-event handler #194323

Closed
BobEvans opened this issue Sep 27, 2023 · 5 comments
Closed
Assignees
Labels
confirmation-pending info-needed Issue requires more information from poster tasks Task system issues

Comments

@BobEvans
Copy link

Does this issue occur when all extensions are disabled?: Yes/No
Yes

  • VS Code Version: 1.82.2
  • OS Version: Ventura 13.5.2

Steps to Reproduce:

  1. Configure a task to run a fish script file
  2. {
    "label": "testfish",
    "type": "shell",
    "options": { "shell": {"executable": "fish"}, "env": {}},
    "command": "/Users//Documents/projects/fish/test.fish"
    },
  3. Configure a preexec hook in ~/.config/fish/config.fish
  4. example:
  5. function my_posthook --on-event fish_postexec
    echo end $argv $fish_pid $status (date +%H:%M:%S) >> ~/fishcmds.log
    commandline
    end
  6. create the shell script
  7. #!/usr/bin/env fish

echo "fish says HELLO $TERM_PROGRAM"
echo 'pwd:'
pwd
functions --handlers
echo "done"

  1. Run the task in vs code. See all output.
  2. Inspect ~/fishcmds.log, none of the commands got added to this log from the preexec function
  3. Try the same thing from a system Terminal or from a VS code fish terminal. It works correctly, the commands issues in the fish shell get added to the ~/fishcmds log as expected.

The weird thing is that the script, test.fish, calls the functions --handler function and it shows the preexec function but it is not getting executed.

@BobEvans
Copy link
Author

Extra note: This still occurs even if you remove "options": { "shell": {"executable": "fish"}, "env": {}},

@meganrogge
Copy link
Contributor

what happens if you disable shell integration? terminal.integrated.shellIntegration.enabled

@meganrogge meganrogge added the info-needed Issue requires more information from poster label Sep 27, 2023
@BobEvans
Copy link
Author

Same behavior

@meganrogge
Copy link
Contributor

Is it possible you need to provide some argument to fish to allow those scripts to run?

@meganrogge meganrogge added the info-needed Issue requires more information from poster label Dec 6, 2023
@vscodenpa
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
confirmation-pending info-needed Issue requires more information from poster tasks Task system issues
Projects
None yet
Development

No branches or pull requests

3 participants