-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Job command is truncated and unreadable sometimes. #2727
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
Comments
The code seems visible in that diff - "truncate_command" in proc.cpp. Though I'd like it if it wouldn't use an additional environment variable. I'd prefer if it filled $COLUMNS, if there has to be any truncation. @ridiculousfish: Remember why you added the truncation? |
I added the truncation because status message could be unreasonably long, especially the "has ended" or "terminated by signal" messages. The command could be so long that the status change itself would be lost. @lisimia what is the context where you want to see longer messages? Is it for these signal status messages? |
is what is see when i run a job in the background and it finishes what was actually ran: i want to see the full command of what job finished. maybe we can provide a custom implementation (function) for |
Thanks for answering my question. What do you do with that information? Do you cross-reference that hash with something else? Or do you want to, say, copy and paste the whole command to run it again? What I'm trying to ascertain is whether there's some smarter truncation or labelling or other behavior that would make this better for everyone, and wouldn't involve introducing new configuration. I suspect you don't actually want to see the whole command, but rather uniquely identifying part of it? But I could be wrong. Maybe when multiple jobs have the same prefix, the truncation could start at the point that's different. |
yes that's the issue, i have up to 20 jobs that have the same starting prefix, one problem i predict in your proposed solution, the last running command (of the 20), would appear like it is the only command thus only print the prefix and not the important part of the command (some arbitrary part in the middle) printing the ending won't work either because in this case it'll only print |
@ridiculousfish To overcome the original problem,
I'd suggest to separate the status from the command. |
bash puts the status before the command - that's kind of clever in fact. |
it would sound like just a rewritten format string in: 6db82c1#diff-2496498d8489caaa1554877d00271179R694 and to not use the |
Sure, go for it. |
With #6959, this is customizable at the user level, without needing to change code in fish-shell. For the specific use-case mentioned in this bug, you can choose exactly how to truncate the command (so, e.g. skip the first 20 characters, or truncate from the end rather than the beginning, or even grep for your hash...), by copying and then altering the fish_job_summary function to your local configuration. |
Issue #1119
and
6db82c1#diff-2496498d8489caaa1554877d00271179R654
forced a maximum length on my jobs.
i run about 10~20 jobs regularly, all over 200 characters long, the first 30 characters, and last 30 characters are always the same
its a bit weird i know.
but i would like to add an environment flag that truncate_command checks for in which if set, will NOT truncate the command.
I view this as a regression because it broke existing behaviour, with no way to go back. I'm willing to put in the code if someone can point me in the right direction
The text was updated successfully, but these errors were encountered: