Enabling TAB on a text terminal sends Ci code to the application (which is an ascii char named TAB), so under tty Ci and TAB are usually indistinguishable. Emacs by default preserves this equivalence in GUI environments by mapping the tab event to Ci when there is no binding for tab (this is done in function-key-map ). Therefore, most packages should associate their commands with a TAB char (i.e. Ci ), and not with the tab event, so that it works equally well under tty or under the GUI. But if you want to distinguish between the two, it is very simple: just bind the command you want to the tab event, and the mapping from tab to Ci will no longer happen.
source share