Skip to content
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

Add timestamp view #9331

Open
costincaraivan opened this issue Mar 2, 2021 · 8 comments
Open

Add timestamp view #9331

costincaraivan opened this issue Mar 2, 2021 · 8 comments
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Milestone

Comments

@costincaraivan
Copy link

costincaraivan commented Mar 2, 2021

Description of the new feature/enhancement

iTerm2 has a very nifty functionality where you press a keyboard shortcut and it creates a sort of side-column (think of the line number column or the debugging column in an IDE) where it shows timestamps for all executed commands in its scroll back buffer, plus for all "significant events".

I think, but don't quote me on that, that it also shows timestamps for important events, for example if there's a time interval longer than X and suddenly there's a message, it shows the timestamp for that, too.

It's great for retroactively investigating something, especially if you have to use a shell which doesn't implement more advanced prompt features. Or for long running operations with sudden bursts of activity.

https://iterm2.com/documentation-one-page.html

Toggle View > Show Timestamps to indicate the time each line was last modified. This is useful for telling how long operations took or when a message was printed.

Proposed technical implementation details (optional)

You press a certain keyboard shortcut/select a menu entry.

An additional column is added to the left of the terminal, containing nicely formatted timestamps, down to the second (maybe millisecond, even?) that shows timestamps for all command executions plus significant events in the entire scrollback buffer, as marked by timing of printing to the screen (pause for longer than Y seconds - maybe make this configurable? - then the next message printed is significant and its timestamp is recorded and shown).

@costincaraivan costincaraivan added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Mar 2, 2021
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Mar 2, 2021
@zadjii-msft
Copy link
Member

I'm gonna toss this on the backlog, because there's prior art for this. Thanks!

@zadjii-msft zadjii-msft added Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Product-Terminal The new Windows Terminal. labels Mar 2, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 2, 2021
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Mar 2, 2021
@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Mar 2, 2021
@WesleyM77

This comment has been minimized.

@costincaraivan
Copy link
Author

costincaraivan commented Nov 11, 2021

@WesleyM77 The bad news for you is that this ticket has just been added to the Icebox.

Based on its name (Icebox), I don't believe this will be implemented any time soon (so maybe several years from now, at best).

@zadjii-msft
Copy link
Member

If you're passionate about it, you're free to contribute this yourself! To be totally honest - given the single +1 this has, I'm doubting this is going to rise to our own priority lists any time soon. It's still a good feature request! I just want to be transparent about where it is in the priority queue. We're always open to being proven wrong though!

I'd suspect that most people just use the prompt in their shell to display this information. I, for example, have my prompt set up like:
image

$T in the %PROMPT% for cmd.exe will display the current time - there are other methods for other shells as well.

@WesleyM77
Copy link

@zadjii-msft woah! Didn't know I could modify the prompt like that!

@zadjii-msft
Copy link
Member

@WesleyM77 You may be interested in
https://github.com/zadjii/keep/blob/master/bin/reprompt.cmd

which is a handy little .cmd script I have for updating the prompt based on branch. Useful if you're using cmd.exe, but there are many more useful alternatives on actually modern shells.

@costincaraivan
Copy link
Author

If you're passionate about it, you're free to contribute this yourself!

I'm not a C++ dev 🙂

I just want to be transparent about where it is in the priority queue. We're always open to being proven wrong though!

It's fine, you're right. I just didn't expect this request to be iced 😀

Iced

@DavidP-Vitro
Copy link

(Yes, I know this request is 2.5 years old, but I just ended up here searching for whether this feature existed.)

One thing not addressed by the workaround of modifying the prompt is seeing timestamps for lines within outputs of commands. Sure, you get a timestamp as soon as the prompt is written after completion of the command, but that doesn't help for the middle of a long-running command.

I did however find some workarounds for this. You need to remember to invoke them when you call you command, but that's good enough for me in most cases.

In most *nix shells you can pipe a command into ts from the moreutils package. (Found as an answer on Stack Overflow.)

In PowerShell you can create a filter function that can be used the same way. (Found here.)
filter ts {"$(Get-Date -Format u): $_"}

To use either one, you then simply pipe your command into it.
ping server | ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

4 participants