Commit f7bd7789 authored by yann300's avatar yann300

provide setTimeout, setInterval in terminal

parent 7797d212
...@@ -702,7 +702,15 @@ function domTerminalFeatures (self, scopedCommands) { ...@@ -702,7 +702,15 @@ function domTerminalFeatures (self, scopedCommands) {
log: function () { scopedCommands.log.apply(scopedCommands, arguments) }, log: function () { scopedCommands.log.apply(scopedCommands, arguments) },
info: function () { scopedCommands.info.apply(scopedCommands, arguments) }, info: function () { scopedCommands.info.apply(scopedCommands, arguments) },
error: function () { scopedCommands.error.apply(scopedCommands, arguments) } error: function () { scopedCommands.error.apply(scopedCommands, arguments) }
} },
setTimeout: (fn, time) => {
return setTimeout(() => { self._shell('(' + fn.toString() + ')()', scopedCommands, () => {}) }, time)
},
setInterval: (fn, time) => {
return setInterval(() => { self._shell('(' + fn.toString() + ')()', scopedCommands, () => {}) }, time)
},
clearTimeout: clearTimeout,
clearInterval: clearInterval
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment