diff --git a/libs/commandio.js b/libs/commandio.js
index <HASH>..<HASH> 100644
--- a/libs/commandio.js
+++ b/libs/commandio.js
@@ -117,7 +117,11 @@ module.exports = {
 // UTILS
 
 function getConsoleWidth(){
-	var stdSize = process.stdout.getWindowSize();
+	try{
+		var stdSize = process.stdout.getWindowSize();
+	} catch (e){
+		var stdSize = [80];
+	}
 	return stdSize[0];
 }
 
diff --git a/tests/commandio-sandbox.js b/tests/commandio-sandbox.js
index <HASH>..<HASH> 100644
--- a/tests/commandio-sandbox.js
+++ b/tests/commandio-sandbox.js
@@ -11,7 +11,3 @@ var context = {
 context.global = context;
 
 module.exports = sandbox(__dirname+'/../libs/commandio.js', context);
-
-module.exports.getConsoleWidth = function(){
-	return 80;
-}
\ No newline at end of file
Catch exception on getConsoleWidth for no console lunch.