 	}
 
 	public func moveTo(x xpos: Int, y ypos: Int) {
-		let x    = max(0, min(xpos, mTerminalInfo.width  - 1))
-		let y    = max(0, min(ypos, mTerminalInfo.height - 1))
-		let code = CNEscapeCode.cursorPoisition(y, x)
+		let x = clip(value: xpos, min: 0, max: mTerminalInfo.width  - 1)
+		let y = clip(value: ypos, min: 0, max: mTerminalInfo.height - 1)
+		let code   = CNEscapeCode.cursorPoisition(y, x)
 		mConsole.print(string: code.encode())
 	}
 

		mLock.unlock()
		return result
	}
}

	private var mHandler:		((_ hdl: FileHandle) -> Void)?
	private var mBuffer:		String
	private var mLock:		NSLock

	public var foregroundColor:	CNColor {
		get		{ return mTerminalInfo.foregroundColor		}
		set(newcol) 	{ mTerminalInfo.foregroundColor = newcol	}
	}

	public var backgroundColor:	CNColor {
		get 		{ return mTerminalInfo.backgroundColor 		}
		set(newcol)	{ mTerminalInfo.backgroundColor = newcol	}
	}

	public init(console cons: CNFileConsole, terminalInfo terminfo: CNTerminalInfo) {
		mTerminalInfo	= terminfo
