I tried running the command
strace -f gnome-terminal --wait |& grep write
and then in the terminal window that opened, I typed ls and pressed enter.
I expected to see write syscalls corresponding to the l, s, \n characters getting sent to the Bash child process running inside the terminal as well write syscalls when the ls child-child process wrote its output, but instead I didn't see any syscalls happening when I ran ls.
I do see these write syscalls when I run
strace -f xterm |& grep write
Why does strace -f fail to follow the child processes of gnome-terminal?
echo $$to get the pid of the current shell and attach this one by using:sudo strace -fp thepid(you might need to use sudo , otherwise you'll get operation not permitted)gnome-terminal-serverthat's doing the terminal emulation isn't a descendant of thegnome-terminalcommand you launch.gnome-terminalstarts upgnome-terminal-servervia some systemd / dbus or similar magic (which I'm not familiar with). You can figure outgnome-terminal-server's PID and attach to it viastrace -p PID. Note that if you have multiple gnome-terminal tabs or windows, this will trace all of them.