Restore xterm keyboard focus after top-level tab changes so macOS users can type immediately without an extra click (discussion #1339). Co-authored-by: Cursor <cursoragent@cursor.com>