hharnisc / hypercwd

Opens new tabs with the same directory as the current tab in Hyper
MIT License
384 stars 39 forks source link

Only launch the process upon a term creation event #30

Open rauchg opened 6 years ago

rauchg commented 6 years ago

Right now exec is triggered upon every single pty data event. It'd be really cool to do it "just in time", so that it's only done for the first pty data event of a new session?

hharnisc commented 6 years ago

Need to think about how to optimize this one @rauchg. The reason why it triggers exec on each pty event is to catch commands like cd /path or if the running application changes its working directory.

I think this is more of a concern on OS X rather than Windows since Windows uses a regex to determine path changes.

One thing that comes to mind would be to periodically poll and update the cwd. Rather than check on every pty event. This would decouple it from the keyboard input and probably feel faster :thinking: