Could be \n or \r
More safety checks on variable indexes.
Properly clear line when running command.