I would like to show the function keys when using the terminal app. However, when I use system preferences to try to set this up in Keyboard Shortcuts, the Terminal app is not selectable.
The reason for this is that Apple doesn't seem to treat its Terminal app in the same way as other apps in terms of permanently setting Functions keys in the Touch Bar. Instead, you need to follow these steps:
Another option is to use another app as your terminal (such as iTerm2) and follow the usual steps for permanently setting the Function keys on the Touch Bar.
Based on your screenshots, it seems you know the steps for doing this, but just to be sure and for the benefit of others:
Now, whenever you are using the app, the Touch Bar should display all the function keys.