Add operating system helpers

Signed-off-by: Michael Buesch <m@bues.ch>
cli: Use escapes only on posix platforms

Signed-off-by: Michael Buesch <m@bues.ch>