Optimize fg/bg changing for slow terminals

Signed-off-by: Peter Atashian <retep998@gmail.com>