mirror of
https://github.com/tmux-plugins/tmux-resurrect.git
synced 2024-11-22 04:18:48 +00:00
Use bash subshell for procfs interpolation of cmdline file
This commit is contained in:
parent
3606e4f602
commit
1431ba6fbe
@ -13,7 +13,10 @@ exit_safely_if_empty_ppid() {
|
|||||||
|
|
||||||
full_command() {
|
full_command() {
|
||||||
[[ -z "$COMMAND_PID" ]] && exit 0
|
[[ -z "$COMMAND_PID" ]] && exit 0
|
||||||
cat /proc/${COMMAND_PID}/cmdline | xargs -0 printf "%q "
|
# See: https://unix.stackexchange.com/a/567021
|
||||||
|
# Avoid complications with system printf by using bash subshell interpolation.
|
||||||
|
# This will properly escape sequences and null in cmdline.
|
||||||
|
cat /proc/${COMMAND_PID}/cmdline | xargs -0 bash -c 'printf "%q " "$0" "$@"'
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
Loading…
Reference in New Issue
Block a user