Set TERM. Do not call setsid if already session leader.
Compile with -std=c99 instead of -std=gnu99