I have insync headless version 3.1.6 through a Gentoo package net-misc/insync version 3.1.6.50206.
$ insync manage_selective_sync <gmail>
Traceback (most recent call last):
File "<string>", line 6, in <module>
File "__main__.py", line 128, in <module>
File "__main__insync-portable__.py", line 150, in <module>
File "isyncd/linux/headless/selsync_manager.py", line 163, in show
File "curses/wrapper.py", line 22, in wrapper
File "curses/__init__.py", line 33, in initscr
_curses.error: setupterm: could not find terminal
Any debugging hints will be greatly appreciated.