Git Product home page Git Product logo

Comments (8)

themattrix avatar themattrix commented on August 16, 2024

It might be tricky to handle all of the edge-cases involved here. In addition to the issue you've pointed out, there's also:

  • too narrow of a terminal causes tasks to overwrite lower ones
  • resizing the terminal while running causes chaos

I'm really not sure how to robustly handle these situations without resorting to a fully-fledged library like curses...and I'd rather avoid the dependency.

😩

Thoughts?

from bash-concurrent.

placeybordeaux avatar placeybordeaux commented on August 16, 2024

Detecting if the window is too small to show all of them and simply going with a smaller status line type thing might be a nice way to keep it simple, but not provide false information.

Could be as simple as branching on tput lines < #jobs

Does that sound reasonable both technically and from a UI point of view?

from bash-concurrent.

themattrix avatar themattrix commented on August 16, 2024

An interesting idea! Were you envisioning something super-compact like a sparkline? Maybe with a little extra info about which task finished most recently?

from bash-concurrent.

placeybordeaux avatar placeybordeaux commented on August 16, 2024

I don't have a strong opinion, I just wanted to use concurrent to run well over 300 tasks with some basic and bounded level of concurrency and was surprised to see it 'start' on #400 or so. I think it's completely reasonable to fall back to whatever basic level of support you think is reasonable when someone has a window smaller than the number of jobs.

from bash-concurrent.

themattrix avatar themattrix commented on August 16, 2024

I'll try some various things with a huge number of tasks and see what works best!

from bash-concurrent.

themattrix avatar themattrix commented on August 16, 2024

I have an experimental branch with an alternate "compact" display for when there are more tasks scheduled than terminal rows. I've also made some performance improvements, as handling a large number of tasks was super slow. It's still not blazing fast, but this is bash after all 😉

Give it a try here: https://github.com/themattrix/bash-concurrent/tree/many-tasks

I've also added a demo for this: ./demo.sh many

I'd still like to tweak the look a bit since it's kind of ugly. Feedback would be much appreciated!

from bash-concurrent.

placeybordeaux avatar placeybordeaux commented on August 16, 2024

Just took a look at it, I think that's a reasonable approach, it might be nice to have info on what recently completed or what is in progress, but that is certainly nicer than it displaying incorrect information.

from bash-concurrent.

themattrix avatar themattrix commented on August 16, 2024

I made a few more tweaks (like adding a recently-completed line), and felt it was good enough to merge it to master. I'll close this issue, but feel free to continue discussion here or open another issue if you discover any bugs!

from bash-concurrent.

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.