Dear all,
When parsing large amount of text from textmate2 to the terminal, it sometimes happens that strange parsing errors occur. Line breaks, white space, or symbols are arbitrarily not send correctly to terminal.
For example; this line in textmate: col <- ifelse(…
ended up like this in terminal: col <col <cse(...
Hence, whenever I want to run multiple lines of code, I end up with errors, which makes it very difficult to work with textmate in combination with terminal.
I use the following command to parse the selected text to the terminal:
#!/bin/bash [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
rawText="$(cat | sed 's/ / /g;')"
#rawText="`cat`"
osascript -e 'on run(theCode)' \ -e 'tell application "Terminal" to activate' \ -e 'tell application "Terminal"' \ -e 'do script theCode in window 1' \ -e 'end tell' \ -e 'end run' -- "$rawText”
Thanks for any help and advice!