It's pretty common to copy-paste POSIX sh one-liners, or `source` a simple script. fish makes this annoying to do.
echo "pwd: $(pwd)"
See https://github.com/fish-shell/fish-shell/pull/8059 bash
PASTE_HERE
exit
Works for everything unless the pasted commands set variables you want to use.