Add a New Comment (Rich Markup)
Comment Type & Canned Response: None None
I don't have any current plans to implement this.
I like this idea, but I wonder if it doesn't go far enough.
Ideally I would like to be able to replay the actions just given the recorded shell history, and the same starting files, and the same user input. I realise that's an unrealistic goal to automate, but I'd like there to be enough clues that a human reading the history can step through it and be reasonably sure of what happened.
I would prioritize putting the shell PID in the history before the cwd.
I would also like:
It would be nice if bash could save and display the directory where a command from its history was run.
I have a patch which adds the path as a string in the `HIST_ENTRY` struct and reads and writes it after the timestamp in the comment line in the history file.
The modified history file looks like:
#1557421027 /Users/me/projects/bash cd lib #1557421028 /Users/me/projects/bash/lib ls #1557421033 /Users/me/projects/bash/lib echo i am in lib #1557421034 /Users/me/projects/bash/lib ls #1557421037 /Users/me/projects/bash/lib cd readline/ #1557421038 /Users/me/projects/bash/lib/readline ls #1557421041 /Users/me/projects/bash/lib/readline cd .. #1557421042 /Users/me/projects/bash/lib ls #1557421043 /Users/me/projects/bash/lib cd .. #1557421044 /Users/me/projects/bash echo
The patch doesn't change the output when `history` is run, but having it display the path in parens just before the command would be useful. It also doesn't change any functionality when running a command from the history, but one could imagine having the ability to first change directory of the saved command before re-execution. It also depends on timestamp saving to be turned on as I didn't add a different boolean for cwd path saving. I just wanted to get feedback before going any farther.
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
Depends on the following items: None found
Items that depend on this one: None found
There is 1 vote so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only logged-in users can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 3 latest changes.
Copyright © 2023 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.10