Giter Site home page Giter Site logo

Comments (9)

apocas avatar apocas commented on May 20, 2024

Thanks!
It's normal in ansi terminal output :)

Had to solve that same problem in nodechecker.com stdout and stderr outputs.

Check this out:
https://github.com/apocas/nodechecker.com/blob/master/public/js/views/module.js#L15
https://github.com/drudru/ansi_up (great lib to convert ansi to formatted html, if you need it)

EDIT:
Just read details...
Humm that seems an encoding issue somewhere. Not the usual ansi formatting issue.
Can't remember if I ever encountered something like that.

from dockerode.

kfatehi avatar kfatehi commented on May 20, 2024

Thank you -- I ended up doing a regex whitelist against the output -- which still sucks but at least it's readable and doesn't destroy the terminal:

var patt = /([0-9a-zA-Z'"#,\-/_ .@]+)/;
stream.on('data', function (chunk) {
  var str = chunk.toString('utf-8');
  var match = str.match(patt);
  if (match) {
    console.log(match[0])
  }
});

from dockerode.

apocas avatar apocas commented on May 20, 2024

Will close this for now.
If we find it's source and if it's related with dockerode then it will be tackled :)

from dockerode.

kfatehi avatar kfatehi commented on May 20, 2024

@apocas please see moby/moby#7375 (comment) should this be handled by dockerode, or my downstream application ?

from dockerode.

apocas avatar apocas commented on May 20, 2024

Humm. Dockerode already tackles this and "demuxes" the streams for you if you want.
Now i think you probably are just not attaching correctly or forgot to demux the stream.

Check this attach scenario in here: https://github.com/apocas/nodechecker-tester/blob/master/lib/container.js#L120

Are you attaching and demuxing like this?

from dockerode.

kfatehi avatar kfatehi commented on May 20, 2024

Ah so I need to use that -- sweet deal thanks @apocas

from dockerode.

apocas avatar apocas commented on May 20, 2024

No problem. Sorry for not figuring out what was happening faster, I thought you were already demuxing :)

from dockerode.

kfatehi avatar kfatehi commented on May 20, 2024

All good man thanks for building this BADASS library :)

from dockerode.

benjick avatar benjick commented on May 20, 2024

Is there any suggested solution for this? The solution by @kfatehi works but it still shows some weird chars

from dockerode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.