manually applying https://github.com/tblobaum/rconsole/pull/3/files