mirror of
https://github.com/asciinema/asciinema.git
synced 2026-04-25 16:05:52 +03:00
[GH-ISSUE #145] Question / documentation: bashrc #113
Labels
No labels
bug
compatibility
feature request
fit for beginners
help wanted
hosting
idea
improvement
packaging
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asciinema#113
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @fulldecent on GitHub (Feb 9, 2016).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/145
I would like to record all shell sessions to files like:
What needs to be done in bashrc to make this happen? And is this implementation advice worth documenting for others?
@dflock commented on GitHub (Feb 19, 2016):
This would probably get you most of the way there:
This defines as bash function called
command_exists, then uses it to only run this if the commandasciinemais available.It then ensures that the
ShellHistoryfolder exists, then starts recording to a timestamped file inside that folder.@dflock commented on GitHub (Feb 19, 2016):
Not 100% sure about this, but probably be careful to put this at the bottom of the
.bashrc- I think that when the user typesexit, the subshell will exit, and execution will continue at the next line of the.bashrc- i.e. it'll run the rest of the.bashrcfile.@ku1ik commented on GitHub (Feb 20, 2016):
Note that asciinema spawns new shell process (
$SHELLby default) so if you addasciinema rec...to your.bashrcit will most probably start spawning thousands of nested asciinema+bash processes, eventually crashing your machine.asciinema recsetsASCIINEMA_RECenv var to1. This can be used to detect if the current bash session is being recorded and preventingasciinema recto start. Something like this at the bottom of.bashrccould do:@fulldecent commented on GitHub (Feb 20, 2016):
Thank you. These look great!