Removing final "exit" from recorded stdout (resolves #138)

This commit is contained in:
Marcin Kulik
2016-02-20 18:47:17 +01:00
parent f693cba9ab
commit 97548dcbff
2 changed files with 5 additions and 0 deletions

View File

@@ -6,6 +6,7 @@
* Playing asciicast from IPFS: `asciinema play ipfs://ipfs/QmcdXYJp6e4zNuimuGeWPwNMHQdxuqWmKx7NhZofQ1nw2V`
* `-q/--quiet` option added to `rec` command
* Fixed handling of partial UTF-8 sequences in recorded stdout
* Final "exit" is now removed from recorded stdout
## 1.1.1 (2015-06-21)

View File

@@ -28,6 +28,10 @@ func (s *Stream) Write(p []byte) (int, error) {
func (s *Stream) Close() {
s.incrementElapsedTime()
if string(s.Frames[len(s.Frames)-1].Data) == "exit\r\n" {
s.Frames = s.Frames[:len(s.Frames)-1]
}
}
func (s *Stream) Duration() time.Duration {