contour icon indicating copy to clipboard operation
contour copied to clipboard

Time of last change for each line/char on terminal

Open al-zatv opened this issue 3 years ago • 7 comments
trafficstars

Contour is really interesting -- and is super fast! I want to use it more. Thank you all for this tool.

Abstract

Terminal users often run long processes. Compile something big, train neural network, scan disk drive or ports. And, it is often good to know, when something happened.

Let say, you run something long in Friday evening. You came back at Monday morning, and see an output:

Stage 1/5 is completed... 
Stage 2/5 is completed... 

So, what happened -- stage 1 and 2 was completed in first 15 minutes, and after that, my process hangs? So, it is better to stop it now? Or, each stage take 1 day each, so now it is better to wait 3 more days? Nobody knows.

Probably, everyone who uses console often, sometimes face this situation.

Motivation

I propose to add mode to view time of change of each line (or char) on screen.

Let say, variant # 1

  • I press Alt+Shift+T
  • near each line i see time of change of this line (for example, to the right of the line)
  • If I drag my mouse to the time, I see date of this change (it can be important for Friday-->Monday situation)
  • On next press of Alt+Shift+T, this time suffix disappear.

variant # 2

  • I press Alt+Shift+T. Start of special "time mode" signaled somewhere in UI (for example, in window caption)
  • I can move my mouse to any char, and see the time of it change in a tooltip
  • On next press of Alt+Shift+T, this mode stops.

(as for me, I prefer 1st option, but 2nd one is also OK and can be useful sometimes)

ps Sorry if this was already discussed

al-zatv avatar May 06 '22 08:05 al-zatv

Hey, thanks for the kind works. Performance is in fact what I lately work on the most, so it seems.

Coming back to your problem. Are you in control of that script? I would suggest to approach the problem from the other side, even non-intrusively:

alias logstamped="awk '{print strftime(\"[%Y-%m-%d %H:%M:%S]\", systime()), \$0};'"

Then, whatever long running command you are having that produces sequencial output, use it like that:

LongRunningScript.sh | logstamped

Example:

image

Otherwise, I am not against adding such functionality, internally the monotonic clock is held already, and adding such an existing meta information to a line isn't expensive, but how to show that I personally find more debatable. Here, I'd highly prefer to wait until Contour has received a plugin API and use that API for extending the core.

christianparpart avatar May 06 '22 09:05 christianparpart

Thank you for 'logstamped' script. I'll save it, it may help in some situations. But, in my opinion, it's good to know when something went wrong -- especially if you don't expect that something may go wrong. So, I think it better to be part of terminal emulator, in my humble opinion.

al-zatv avatar May 06 '22 10:05 al-zatv

I am not against adding such functionality

I am against. It's not TE's task.

data-man avatar May 06 '22 10:05 data-man

It's not TE's task.

TE's task is to allow power user to work with console software in most productive way, isn't it? Productivity of group of users who work with long processes will increase from this feature, isn't it? (I will answer myself -- yes, it is. Less problems with logging, especially logging on 3rd party tools,etc). So, this is TE's task.

al-zatv avatar May 06 '22 12:05 al-zatv

power user to work with console software in most productive way, isn't it?

A power user can develop/find suitable tool. It's very likely that such TUI/GUI tool already exists.
TE should not be like Nero Burning ROM.

data-man avatar May 06 '22 12:05 data-man

Honestly, having this done through scripting/plugin API wouldn't be a bad thing, I do disagree with @data-man though, modern TE should have more (sensible) features than it's predecessors.

uspasojevic96 avatar May 06 '22 13:05 uspasojevic96

It's not TE's task.

TE's task is to allow power user to work with console software in most productive way, isn't it? Productivity of group of users who work with long processes will increase from this feature, isn't it? (I will answer myself -- yes, it is. Less problems with logging, especially logging on 3rd party tools,etc). So, this is TE's task.

i'm all in for empowering the users. sometimes it's a core TE feature to be implemented (vi-like input modes for example), and sometimes some tool in between (e.g. a terminal screen recorder can be tooled as man-in-the-middle software).

For your idea, i'm not against, I lag some imagination in visualization, but I'd like to keep this ticket open specifically as motivation for scripting API requirements. I can't promise you anything soon, as other points are currently more pressing (stability, performance (finish open topics), Good Image Protocol, double-width/height text, UI tabs (ideally in the title bar :)).

christianparpart avatar May 06 '22 21:05 christianparpart