Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shelljs is incompatible with blessed. #214

Closed
Roxyhuang opened this issue Oct 25, 2017 · 4 comments
Closed

Shelljs is incompatible with blessed. #214

Roxyhuang opened this issue Oct 25, 2017 · 4 comments
Labels

Comments

@Roxyhuang
Copy link

Roxyhuang commented Oct 25, 2017

====================================================================

If the issue is visual, please provide screenshots here

in iTerm2 will be show some messy code

Cf0Ce0Cd0Cc0Cb0Ca0C`0C^0C]0C\0CZ0CY0CX0CW0CW1CV1CU1CT1CS1CR1CQ1CP1CO1CN1CL2CK2CJ2CI2CH2CF2CE2CD2CC2CB2CA2C@2C?

====================================================================

Steps to reproduce the problem
  1. start run script in package.json for script file
  2. run dashboard in javascript file by shell.js
  3. show some messy code

====================================================================

Please provide a gist of relevant files

minimal repository : https://github.com/Roxyhuang/dashboard-shell-error.git

====================================================================

More Details

OS X 10.12.5
iTerm2
"webpack-dashboard": "1.0.0-5"
"webpack": "3.6.0",
"shelljs": "0.7.8",

@ryan-roemer
Copy link
Member

Can you provide a minimal repository with install / reproduction steps to see the error? This will greatly aid our efforts at figuring out what's going on. Thanks!

@Roxyhuang
Copy link
Author

Roxyhuang commented Oct 27, 2017

@ryan-roemer
You can clone the repository:
https://github.com/Roxyhuang/dashboard-shell-error.git

Please use

npm run dev

Thank you very much!!!

====================================================================
More Details

OS X 10.12.5
iTerm2
"webpack-dashboard": "1.0.0-5"
"webpack": "3.6.0",
"shelljs": "0.7.8",

@ryan-roemer
Copy link
Member

I do see the behavior you've noted in your repository -- thanks!

However, looking at these issues:

... it seems like shelljs just doesn't support full terminal features like colors, and presumably all of the cursor magic for a full-fledged library like blessed.

Is shelljs supposed to support blessed and blessed-based applications?

@ryan-roemer
Copy link
Member

Confirm. shelljs is incompatible with blessed. I took the absolute simplest blessed example app and ran it in your setup with this diff:

diff --git a/bin/commands.js b/bin/commands.js
index 0a7fd66..500498f 100644
--- a/bin/commands.js
+++ b/bin/commands.js
@@ -6,6 +6,7 @@ const option = process.argv[2];
 switch (option) {
     case 'dev':
       console.log(chalk.green('building for development...'));
-      shell.exec('webpack-dashboard -p 3300 -c blue -t dashboard -- babel-node script/dev-server.js dev');
+      shell.exec('node node_modules/blessed/example/simple-form.js');
+      //shell.exec('webpack-dashboard -p 3300 -c blue -t dashboard -- babel-node script/dev-server.js dev');
       break;
 }
diff --git a/package.json b/package.json
index 82b59af..f0b8893 100644
--- a/package.json
+++ b/package.json
@@ -13,7 +13,10 @@
     "not ie < 9"
   ],
   "dependencies": {
-    "shelljs": "^0.7.8"
+    "blessed": "^0.1.81",
+    "pty.js": "^0.3.1",
+    "shelljs": "^0.7.8",
+    "term.js": "^0.0.7"
   },
   "devDependencies": {
     "babel": "^6.23.0",

and I got the exact same gibberish output spewing throughout the console.

I'm going to close this issue as it's not something specific to webpack-dashboard, but rather to shelljs's presumable handling of complex terminal output. Feel free to add a doc PR here if you'd like to call out shelljs' issues and if you'd like cc me on any issues you open up on shelljs and/or blessed to address the root cause so I can track it and eventually see if that combination will get support that we could document here on the dashboard.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants