Skip to content

Commit

Permalink
Merge pull request #7 from simonwalz/shell-escape
Browse files Browse the repository at this point in the history
Fixes for "some issues" #5
  • Loading branch information
simonwalz authored May 11, 2022
2 parents 1413933 + 9df5493 commit f96c077
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions screen-save
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,11 @@ fi
# get screens cwd:
SCREEN_CWD="$(screen -S "${SCREEN_ID}" -Q echo '${PWD}')"

write "source \"${HOME}/.screenrc\""
write "# from .screenrc (filtered):"
write "$(grep -Ei "^(def|source|colon|setenv|unsetenv|shell|shelltitle|term|password|lockscreen|multiuser|acladd|addacl|aclchg|chacl|acldel|aclgrp|aclumask|umask|wall|resize|caption|fit|mousetrack|width|height|utf8|scrollback|bind|unbindall|escape|meta|dump|echo|sleep|log|startup_message|debug|crlf|caption)" "${HOME}/.screenrc" 2>/dev/null)"
#write "source \"${HOME}/.screenrc\""
write
write "# saved session:"
write "sessionname \"${SCREEN_NAME}\""
write

Expand Down Expand Up @@ -203,7 +206,7 @@ do
# get window contents, alter it, zip it, encode it with base64:
WINDOW_CONTENTS="$(awk '/^$/{next}NR>1 {print last} {last=$0}' \
"${HOME}/.screen_hardcopy/${SCREEN_NAME}_${WINDOW_ID}" | \
gzip -c | base64 | sed ':a;N;$!ba;s/\n/\\n/g')"
gzip -c -9 | base64 | sed ':a;N;$!ba;s/\n/\\n/g')"
rm "${HOME}/.screen_hardcopy/${SCREEN_NAME}_${WINDOW_ID}"

debug "[${WINDOW_ID}] ${WINDOW_TITLE} - ${WINDOW_CL}"
Expand Down Expand Up @@ -263,7 +266,8 @@ write "# bug in screen: changing cwd of screen breaks term cap:"
write "chdir \"${SCREEN_CWD}\""
write "chdir"
write
write "#windowlist"
write "# bug in screen: last write command not executed"
write "screen '/bin/false'"
write
write "# vim: ft=screen"

Expand Down

0 comments on commit f96c077

Please sign in to comment.