-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathhistory notes
170 lines (114 loc) · 4.62 KB
/
history notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
[] plumb history fetch to Job
[] return fixed history from a parsed JSON string
[] change who picks job names
[] store history
[] convert from ReportOne to Report interfaces
idea one:
let front end name jobs
backend stores in history via it's own ids, but reports in front-end names
for history reporting, generates yet different front-end job names
shell will have to keep a history counter
already keeps front end jobs
need a way to indicate when a job shouldn't be stored in history
shell has to find / make history directory when it starts
shell has to inventory previous history entries to both find new starting
point, as well as giving front end a way to know what there is
history ideas
20120919T122900.0
2012-09-19.12:29:00.0
20120919.122900.0
c-20120919.122900.0-cat_README
c-20120919.122901.1-ls
$HOME/.plush/session/history/cmd-<date>.<time>.<n>-<cmd>
[] on start up
mkdir -p $HOME/.plush/session/history
-- in future need to do some interlock of some sort
ls -l > history list
(old, history) <- splitFromBack 500 historyList
rm old
initialize counter to last entry of history (or "")
[] front end request "history prior to"
starting at newest command, read command file, parse
add to return status
while return size is rational
if more to do
[] locking:
fd <- openefile...
setLock fd (WriteLock, AbsoluteSeek, 0, 0)
-- throws if can't set
-- if anyone ever closes that file (not that fd!) the lock is lost
TASKS
------
[] stamps
[x] build stamp prefix from time
[] save last used prefix, count
[] if new == last, bump count
[] file name from time+count+santized(cmd)
[x] on start up, mkdir -p $HOME/.plush/session/history
[] remove 'running: false' from FinishItem
-----------
[] on start up get filelist from history dir
[x] on history request
[x] read each file, reply with items
[] command lines with parser errors should produce a different entry in the
history file than just a simple stderr line
[x] split command info and output into separate files
- 20121105.1134.0.cmd & 20121105.1134.0.out
[x] ship just commands on history request
[x] request for output for a command in history
[x] back-end API end point for requesting
[x] front-end request ouptut ... as user opens? last 6 hours? until a gap?
[] add time and working directory to command file
[] add command to "all-time" command list
[] kill output on full-screen
[] back-end API for killing output
[] send kill-output on entering full-screen
[] handle missing output file gracefully
[] commands without output should not be deferred, but be in some no-output state
API or just built-in command?
history list:
find dir -- won't match what job is doing exactly, will it!
enumerate dir -- easy
read contents -- easy
return as JSON -- easy if we don't parse it as [HistoryItem]
history output:
find file -- easy
return as JSON -- easy if we don't parse it as [OutputItem]
kill output:
find file -- easy
delete -- easy
sync to job system no longer recording -- hard
kill command
find files -- easy
delete - easy
sync to job system no longer recording -- hard
[x] entering history search should focus on command line if needed
[x] return should enter current focus into command line
[x] ensure that focused entry is always scrolled into view
[x] better css
[-] for when in history mode
[x] for the focused item
[x] corner cases better
[x] when the selection goes empty shouldn't loose focus place
[x] when focus at bottom with dir 1 goes out of match, then back in
[x] bindings
[x] should ESC key enter or cancel - cancel
[x] should ALT+/ and ALT+\ enter history search - yes
[x] what key should be bound to clear the search field - C-u
[] scroll list so that it is at bottom, not top of screen
[-] animate hiding/showing of output ?
[-] display focused entry overlaid onto command line ala completion ?
[-] restore commandline on cancel search?
From readline's History UI
C-r : incremental search backward
C-s : incremental search forward
-- these both start the search, and continue in the direction given
esc, C-j : terminate search, inserting c71urrent match
C-g : cancel search, inserts nothing
<character> : enters into text field, narrows search
<bs>, <del> : delete in text field, widens search
c-p, c-n : prev/next in history -- our opt-up, opt-down
M-<, M-> : begin/end of history
M-p, M-n : non-incremental search back/forward
M-C-y : yank n-th arg
M-., M-_ : yank last arg