allow starting commands in new tabs via CLI (fixes #304)

This commit is contained in:
Eugene Pankov
2018-08-26 17:35:04 +02:00
parent 3f8f87a141
commit 6cc20c3719
23 changed files with 1006 additions and 411 deletions

15
app/lib/lru.js Normal file
View File

@@ -0,0 +1,15 @@
let lru = require('lru-cache')({ max: 256, maxAge: 250 })
let fs = require('fs')
let origLstat = fs.realpathSync.bind(fs)
// NB: The biggest offender of thrashing realpathSync is the node module system
// itself, which we can't get into via any sane means.
require('fs').realpathSync = function (p) {
let r = lru.get(p)
if (r) return r
r = origLstat(p)
lru.set(p, r)
return r
}