arjunmehta / multiview Goto Github PK
View Code? Open in Web Editor NEWSpawn multiple processes and channel their outputs into separate little column views.
License: MIT License
Spawn multiple processes and channel their outputs into separate little column views.
License: MIT License
nice try !
It would have been useful if the lines were wrapped to the following row instead of being truncated.
'pr' does similar work to this
Installing multiview on Windows 10 fails... expected?
C:\dev\git\someApp>node --version
v7.7.2
C:\dev\git\someApp>yarn --version
0.21.3
C:\dev\git\someApp>npm --version
4.1.2
C:\dev\git\someApp>yarn add multiview
yarn add v0.21.3
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/1] ⠁ buffertools: MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix t
[-/1] ⠂ waiting...
[-/1] ⠂ waiting...
[-/1] ⠂ waiting...
error C:\dev\git\someApp\node_modules\buffertools: Command failed.
Exit code: 1
Command: C:\WINDOWS\system32\cmd.exe
Arguments: /d /s /c node-gyp rebuild
Directory: C:\dev\git\someApp\node_modules\buffertools
Output:
C:\dev\git\someApp\node_modules\buffertools>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\Yarn\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | ia32
gyp info spawn C:\Python27\python.exe
gyp info spawn args [ 'C:\Program Files (x86)\Yarn\node_modules\node-gyp\gyp\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=auto',
gyp info spawn args '-I',
gyp info spawn args 'C:\dev\git\someApp\node_modules\buffertools\build\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Program Files (x86)\Yarn\node_modules\node-gyp\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Users\chadb_000\.node-gyp\7.7.2\include\node\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\Users\chadb_000\.node-gyp\7.7.2',
gyp info spawn args '-Dnode_gyp_dir=C:\Program Files (x86)\Yarn\node_modules\node-gyp',
gyp info spawn args '-Dnode_lib_file=node.lib',
gyp info spawn args '-Dmodule_root_dir=C:\dev\git\someApp\node_modules\buffertools',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:\dev\git\someApp\node_modules\buffertools\build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=Win32' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [C:\dev\git\someApp\node_modules\buffertools\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files (x86)\Yarn\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:194:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\Yarn\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\dev\git\someApp\node_modules\buffertools
gyp ERR! node -v v7.7.2
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
C:\dev\git\someApp>
This is a big task, but it would be great to not have to strip ansi codes but instead actually use them to help us know how to lay out the content in the columns.
Some ansi codes interfere with formatting, for example ones that clear an entire line. This would mess up other columns, so we ignore them.
But there are some safe ones like colour, that would be nice to keep for presentation purposes.
Currently all ANSI codes are stripped, and a substring (as wide as a column) of the remaining string is displayed. If we honoured colour codes/tags we'd need to find a way of keeping them in the string somehow and closing them properly.
Windows has unique shell behavior (particularly with cmd
and bat
execution). There is a concern that this package will behave differently on the various versions of windows and node.
Ideally we will want to test a matrix of node versions 1-7, on various versions of windows.
Travis only supports MacOS and Linux right now. No windows support.
I've found tea-ci.org, but seems not as simple as travis to set up for node. Worth looking into.
Error: Cannot find module './build/Debug/buffertools.node'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/usr/local/lib/node_modules/multiview/node_modules/buffertools/buffertools.js:26:20)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
Also consider to capture exit codes from stream instances and exit the display with an error code if one of the streams exits with an error.
The problem is that since you are piping into stdin, you don't know what is an error or not coming from the process. Hmm.
When using multiview -s
, a socket is used for communication. Its path is described as:
var socketPath = path.join(__dirname, '/' + channel + '.sock');
If I understand correctly, __dirname
is the path of the library, wherever it is installed. When multiview
is installed with a package manager (e.g., on the AUR) it is installed in privileged directory, and the file failed to be created (with no error!).
Hence feature request: Allow for that dirname to be customized, and for an error message to be spat out if the file can't be created.
I'm not sure if this is a Windows 7 issue or not -- but any commands I try to use in multiview fail with Exit code 1
Using multiview@latest
Is this a know issue / limitation?
Thanks! Chad
To reproduce this on Windows: .\node_modules\.bin\multiview ['msinfo32.exe']
You will see msinfo32 show up, when you kill multiview, msinfo32 keeps running. I see this also with non-gui applications like yarn run server
, msinfo32 just provides a visible + portable repro because the process that you run matches the visible window.
This obviously relates to the introduction of the shell
option by #6
I think this might be a decent workaround: nodejs/node#3675 (comment)
That above issue was also referenced in discussion of #5
I plan to prepare a PR with this workaround to see if you accept it.
First off, thanks for this fantastic library - I have found it very useful for streaming output from a multiprocess build/watch system.
My question: does the current implementation provide any way to toggle the display of a column on and off, while leaving the spawned process running?
If not, is this even conceptually possible? If it's something that could work but we currently lack the API for it, I'd be happy to contribute an implementation if can give me some high-level advice on how to approach the problem.
I'm trying to use multiview with yarn and I want to have this in my "scripts"
section of package.json
:
"dev": "yarn build:dev && multiview [yarn watch] [yarn run:api] [yarn run:server]"
But after the build:dev
scripts finishes (just runs webpack with dev config) multiview starts and displays <command> (done)
and Exited with code 1
for each command without ever running them.
I have confirmed that this is not due to webpack or nodemon (which are used in my watch and run:* tasks) by having this in my "scripts"
section:
"testmv1": "multiview [yarn lsla]",
"testmv2": "multiview [ls -la]",
"lsla": "ls -la"
Running yarn testmv1
shows same behavior as my config (i.e. the lsla
script is not executed by multiview and it reports exit code 1) while running yarn testmv2
executes ls -la
and displays its output correctly.
I have tested this on Windows 10 (x64, latest insider fast build) with Node v7.8.0 and Yarn v0.22.0 (which is current RC, tried first with latest stable v0.21.3 but it's the same behavior with both versions).
For some reason, the output of supervisor's spawned processes doesnt make it to the multiview
an example of this can be seen here (marcus13345/vogue) by installing and running the dev script.
The process is spawned and runs (as can be seen by the files it generates, in /coverage), however only the output directly from the supervisor process is output.
this issue also is specific to windows. Tested and working on macos, and I dont have a linux machine to test there.
Edit: I am able to work around the issue by adding the -t
flag. which disables interactivity.
in their source, this appears to be the only relevant code, however i am unable to create a small test case, revolving around it.
stdin.setEncoding( 'utf8' );
stdin.on('readable', function() {
var chunk = process.stdin.read();
//
// Restart process when user inputs rs
//
if (chunk !== null && chunk === "rs\n" || chunk === "rs\r\n") {
// process.stdout.write('data: ' + chunk);
crash();
}
});
Hi, thanks for your support, congrats for your work and happy Xmas!
I am trying to use the plugin with docker and I don't know if it is needed a special configuration.
Hope you can help me.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.