So, I needed to use the 1password CLI from vscode-fhs, but it didn't work because the sandbox user wasn't the same as the native one.
tc001 ~/foo> op whoami
[ERROR] connecting to desktop app: read: connection reset, make sure 1Password CLI is installed correctly, then open the 1Password app, select 1Password > Settings > Developer and make sure the 'Integrate with 1Password CLI' setting is turned on. If you're still having trouble connecting, restart the app.
Thankfully this was pretty easy to solve once I figured it out, but it wasn't really doccumented anywhere.
su doesn't work, even if I set a non root user (setuid binaries are restricted), but run0/systemd-run does!
So all you need to do is create a new shell profile that spawns fish with systemd-run in your user settings:
"terminal.integrated.profiles.linux": {
// ...
"fish-fhs": {
"path": "systemd-run",
"args": [
"--user",
"--pty",
"--quiet",
"--same-dir",
"--service-type=exec",
"fish"
]
}
},...and optinally set it as the default one!
"terminal.integrated.defaultProfile.linux": "fish-fhs"(you can replace fish with your shell of choice)
And it magically starts to work!
tc001 ~/foo> op whoami
URL: https://my.1password.eu/
Email: xxxxxxxxxxxxxxx
User ID: xxxxxxxxxxxxxxx
This does have a drawback of the terminal title no longer reflecting the running process, let me know if there is a way around that!
Hope this helps and happy coding!
This is so cool and useful! Thanks