Ted Lyngmo
2021-05-25 20:48:27 UTC
The origin of my question: https://stackoverflow.com/questions/67674633/fedora-34-pasting-multiple-commands-into-a-bash-terminal-behavior-change
After upgrading from Fedora 33 (bash 5.0.17(1)-release) to 34 (bash 5.1.0(1)-release) the shell behaves odd. When pasting to shell, the pasted text is automatically marked, as if selected and it breaks earlier behavior. Pasting this:
```
echo first $SHLVL
bash
echo $SHLVL
bash
echo $SHLVL
exit
echo $SHLVL
exit
echo last $SHLVL
```
would in a fresh login session in bash 5.0.17 print "first 1", "2", "3", "2", "last 1". In 5.1.0 nothing happens until you press return after the paste - and then you find yourself in SHLVL 2 or 3. The sequence is not executed. Sometimes, SHLVL says 2 - and "pstree -alps $$" confirms that the original bash login shell is owning the current shell - yet "exit" will exit the login session completely.
The workaround I've found for this odd behavior is to add the following in my .bashrc:
oldterm=$TERM;export TERM=dumb;export TERM=$oldterm;unset oldterm
This seems to set the login shell in a mode that acts like it previously did.
Is this know? Deliberate? If this is "as designed", is there an option to turn it off?
After upgrading from Fedora 33 (bash 5.0.17(1)-release) to 34 (bash 5.1.0(1)-release) the shell behaves odd. When pasting to shell, the pasted text is automatically marked, as if selected and it breaks earlier behavior. Pasting this:
```
echo first $SHLVL
bash
echo $SHLVL
bash
echo $SHLVL
exit
echo $SHLVL
exit
echo last $SHLVL
```
would in a fresh login session in bash 5.0.17 print "first 1", "2", "3", "2", "last 1". In 5.1.0 nothing happens until you press return after the paste - and then you find yourself in SHLVL 2 or 3. The sequence is not executed. Sometimes, SHLVL says 2 - and "pstree -alps $$" confirms that the original bash login shell is owning the current shell - yet "exit" will exit the login session completely.
The workaround I've found for this odd behavior is to add the following in my .bashrc:
oldterm=$TERM;export TERM=dumb;export TERM=$oldterm;unset oldterm
This seems to set the login shell in a mode that acts like it previously did.
Is this know? Deliberate? If this is "as designed", is there an option to turn it off?