mirror of
https://github.com/tmux-plugins/tmux-resurrect.git
synced 2024-11-21 20:08:48 +00:00
24 lines
380 B
Bash
Executable File
24 lines
380 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
PANE_PID="$1"
|
|
COMMAND_PID=$(pgrep -P $PANE_PID)
|
|
|
|
exit_safely_if_empty_ppid() {
|
|
if [ -z "$PANE_PID" ]; then
|
|
exit 0
|
|
fi
|
|
}
|
|
|
|
full_command() {
|
|
[[ -z "$COMMAND_PID" ]] && exit 0
|
|
cat /proc/${COMMAND_PID}/cmdline | xargs -0 printf "%q "
|
|
}
|
|
|
|
main() {
|
|
exit_safely_if_empty_ppid
|
|
full_command
|
|
}
|
|
main
|