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

Use bash subshell for procfs interpolation of cmdline file #450

Merged
merged 1 commit into from
Aug 17, 2022

Conversation

mdeguzis
Copy link
Contributor

See #449

Base stackexchange reasoning: https://unix.stackexchange.com/questions/243142/how-to-show-quoted-command-list/567021#567021

Further reading: https://unix.stackexchange.com/questions/432419/unexpected-non-null-encoding-of-proc-pid-cmdline/432681#432681

Testing

$ pgrep -a vim
70431 vim --cmd set pythonthreehome=/project/env/altternative/python3.8 /home/mdeguzis/.tmux.conf
74234 vim --cmd set pythonthreehome=/project/env/altternative/python3.8 save_command_strategies/linux_procfs.sh
91608 vim --cmd set pythonthreehome=/project/env/altternative/python3.8 --cmd set pythonthreehome=/apollo

$ COMMAND_PID=7043
$ cat /proc/${COMMAND_PID}/cmdline | xargs -0 bash -c 'printf "%q " "$0" "$@"'

# Produces totally valid and usable command:
vim --cmd set\ pythonthreehome=/project/env/altternative/python3.8 /home/mdeguzis/.tmux.conf

@bruno- bruno- merged commit 75458f9 into tmux-plugins:master Aug 17, 2022
@bruno-
Copy link
Member

bruno- commented Aug 17, 2022

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants