Fix bugs in terminalSetPIxelWidth and write tests for it.