tab handling for terminal