-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Shellcode for fish #838
base: main
Are you sure you want to change the base?
Shellcode for fish #838
Conversation
Pull Request Test Coverage Report for Build 6667484083
💛 - Coveralls |
src/modes/shellcode.ts
Outdated
echo "#!/bin/sh" > "$d/x.$fish_pid" | ||
echo -n "exec " >> "$d/x.$fish_pid" | ||
echo "$argv" >> "$d/x.$fish_pid" #FIXME needs quoting :/ | ||
chmod u+x "$d/x.$fish_pid" |
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.
If you use a fish script instead of an sh script, you should be able to use something like this:
echo -n "exec " > "$d/x.$fish_pid"
for arg in $argv
string escape $arg >> "$d/x.$fish_pid"
echo -n " " >> "$d/x.$fish_pid"
end
And then in the definition of x
call the script with fish "${tmp}/shellcode/x.$fish_pid"
. Or use a fish shebang. Not sure which is better.
I also tried to implement fish support here: https://github.com/Lythenas/pkgx/tree/fish-support I basically just translated the posix code, and since then I think there were changes of the shellcode in pkgx. But feel free to use that as a reference if it is useful. I didn't open a PR because I wasn't confident that my code is correct and I also didn't really like the implementation (the --fish flag and the way I built the shellcode).
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.
thank you this is very useful!
@mxcl Don't forget this :) |
Very eager for this~ |
7947ae5
to
533350e
Compare
@mxcl let us know if you need any testers for this! Looking forward to seeing this merged. |
I think I need to refactor the shellcode and other related pieces before this will be maintainable. I don't use fish (only because in general I stick with defaults so that I know what most of my users deal with on a day to day basis) and as a result it would be easy for it to end up breaking unless the underlying infra is solid. Also not knowing fish it's hard to write. I am mostly using ChatGPT to translate. |
@mxcl Do you have anything in specific about how I might be able to help? |
@mxcl I've got fish scripting experience too, let us know if you want support. |
I'm at your service too, @mxcl. Looking forward to fish support |
9038067
to
342373c
Compare
This would help contributing to the pantry, as it relies on integration https://github.com/pkgxdev/pantry?tab=readme-ov-file#contributing |
Refs #704