Comments (8)
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.
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.
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.
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.
I'll try some various things with a huge number of tasks and see what works best!
from bash-concurrent.
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.
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.
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)
- Unset all namespaced concurrent functions and variables in task's context.
- Disallow requirement loops.
- Add a dry run flag and/or environment variable.
- Namespace "get_tasks_not_in" function.
- Use first argument as task delimiter.
- Run shellcheck automatically on push.
- Demo hangs on Cygwin HOT 14
- An "--and-then" flag should separate groups of concurrent tasks. HOT 2
- Gracefully handle running without a tty.
- add project to the bpkg [Lightweight bash package manager ]
- Immediate Failure event-pipe error HOT 2
- bash 5.x support
- Does this work with zsh? HOT 1
- Request to define all variables before use and check for undefined variables
- Display a constantly-updating widget to inform the user that the script hasn't frozen.
- Add --require-all and --before-all flags as shortcuts.
- Don't allow a task to require itself.
- Add a "--sequential" flag.
- Namespace all functions and varables to avoid overriding things in the task's environment.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bash-concurrent.