repo.or.cz
/
screen-lua.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Allow a callback after every command
[screen-lua.git]
/
src
/
scripts
/
cmdcallback.lua
blob
cc5d2a377c1f1c96b09380fc2e9262318859ae21
1
--[[ For now, this sample function will simply record all the commands executed ]]
--
2
function
command_executed
(
name
,
args
)
3
local
f
=
io
.
open
(
'/tmp/debug/ll'
,
'a'
)
4
f
:
write
(
"Command executed: "
..
name
)
5
6
for
i
,
c
in
pairs
(
args
)
do
7
f
:
write
(
" "
..
c
)
8
end
9
10
f
:
write
(
"
\n
"
)
11
f
:
close
()
12
end
13