When you are connected to a SFTP site and the SFTP window is in focus, the touch bar actions do not operate on the infocus window.
For example, with a file/folder selected and in the focused SFTP windows, pressing the delete key instead of deleting the selected file/folder instead delete's the selected object in the navigation window.
The same is true of the settings button.
This is dangerous, as it allows for accidental deletion of credentials and connections.
our touch bar implementation currently always operates on selected objects in the navigation panel/sidebar. It is NOT context sensitive at the moment.
I'm moving your request to the "Ideas" forum.