Skip to content

Commit

Permalink
init (sesshist) session on recall when it doesn't exist, minor change…
Browse files Browse the repository at this point in the history
…s to readme
  • Loading branch information
curusarn committed Dec 18, 2019
1 parent f73e4f9 commit e027573
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ Imagine being able to search your shell history based on both the command itself

- :heavy_check_mark: Be compatible with Linux and macOS

- :heavy_check_mark: Require very little prerequisite software
- :white_check_mark: Require very little prerequisite software
- :heavy_check_mark: Linux
- :x: MacOS

- :white_check_mark: Show cool graphs based on recorded history

Expand All @@ -92,6 +94,8 @@ Standard stuff: `bash`, `curl`, `tar`, ...

Additional prerequisities: `bash-completion` (if you use bash)

MacOS: `coreutils`

## Installation

### Simplest
Expand Down
5 changes: 3 additions & 2 deletions pkg/sesshist/sesshist.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,9 @@ func (s *Dispatch) Recall(sessionID string, histno int, prefix string) (string,
s.mutex.RUnlock()

if found == false {
// go s.initSession(sessionID)
return "", errors.New("sesshist ERROR: No session history for SessionID " + sessionID + " - should we create one?")
// TODO: propagate actual shell here so we can use it
go s.initSession(sessionID, "bash")
return "", errors.New("sesshist ERROR: No session history for SessionID " + sessionID + " - creating one ...")
}
log.Println("sesshist - recall: Locking session lock ...")
session.mutex.Lock()
Expand Down

0 comments on commit e027573

Please sign in to comment.