tcsh-org / tcsh

This is a read-only mirror of the tcsh code repository.
https://www.tcsh.org/
Other
232 stars 42 forks source link

Make history record success/failure of each entry #38

Open BenAveling opened 3 years ago

BenAveling commented 3 years ago

As well as recording the command and the time, it would useful if tcsh could also record the "$status" (AKA "$?") returned by each command.

This would allow the user to see not just what commands have been run, but which ones had an effect or not.

For example, history could display an extra column, with perhaps one character for success and a different character for failure.

Personally, I like to use "/" for success, because it reminds me of a tick, and I use "X" for failure. But maybe that's just me.

Another option would be to display the actual numeric status, or to display "X" for failure and a blank " " for success.

Without having checked the existing codebase, I see two potential issues:

If people might be prepared to consider such a feature (and it could of course be implemented as optional), then I am prepared to investigate and see if I can produce a working proof-of-concept.