Terminal not responding to "which", "type", etc. commands
textedit is not on the PATH normally so which and whereas which search that will not find it.

ls and cd look in any directory and so can see the files

In the GUI the Finder is the app (or in command line open) that knows where to find Text to open a file.