If you’re tired of GNOME Terminal asking “Close this terminal?” or “Close all terminals?” every time you hit Ctrl+D or close a window, you’re not alone. This confirmation is enabled by default and can quickly become annoying.
By default, GNOME Terminal shows a confirmation dialog when you try to close a window or tab that has running processes ( a ssh connection count as a running proscess ).
in a terminal just run this command :
gsettings set org.gnome.Terminal.Legacy.Settings confirm-close false
after that run
gsettings get org.gnome.Terminal.Legacy.Settings confirm-close
il the command return : false the setting is good and will no longer see that dialog