Startup a fresh GTK emacs with no config with emacs -Q. Then run M-x shell. Then at the prompt:
$ ps -ef
Long commands will be truncated to the frame width, like this:
root 526315 2 0 15:08 ? 00:00:00 [kworker/6:2-eve
So far, this matches normal terminal behavior. But if you do:
$ ps -ef | grep kworker
In emacs shell-mode it will still be truncated, but in a non-emacs terminal (e.g. xterm) the line will not be truncated. Why is this? How do I get it to match normal terminal behavior?
I've noticed shell-mode will respect $COLUMNS, so you can set it to a large value as a temporary fix, but this is unnecessary in a regular terminal where piping will prevent truncation regardless of the $COLUMNS value, and shell-mode always assigns $COLUMNS back to the frame width on the next command.