在shell中,我們粘貼多行代碼的時候,shell大概率會把“換行”識別為“回車”并逐行運(yùn)行豆励,這會導(dǎo)致你沒法粘貼多行的代碼。這是因為shell很難知道你的輸入是不是“粘貼”。
解決這個問題只需要知道一個關(guān)鍵詞:bracketed paste
用google或者bing搜索這個關(guān)鍵詞就會有解決方案良蒸。
Bracketed Paste Mode in Terminal
文中給出解決方案是:
#turn on bracketed paste mode
printf "\e[?2004h"
#disable this mode
printf '\e[?2004l'