romgrk / termrk

Terminal for atom, using pty.js & term.js
MIT License
33 stars 7 forks source link

Option to reset automatically on project change #81

Open ghost opened 8 years ago

ghost commented 8 years ago

Hello

With the advent of packages that allow you to switch projects, you can currently switch projects without opening a new Atom window. When that happens, termrk will maintain its state (, but only if it has been opened at least once). I see this as intended behavior, but am wondering if it would be possible to have a setting that automatically exits/resets/reinitializes the terminal as soon as the active project changes (i.e. by listening to atom.project.onDidChangePaths)?

Currently when switching projects, I am constantly cd-ing between their folders if I happened to have opened termrk at least once. What's worse is that I sometimes don't remember that I have to do this and run a dangerous command in the wrong folder. This is of course not termrk's fault, but having an option would make life easier.

Thanks in advance and keep up the good work!

romgrk commented 8 years ago

Hello, sorry, work! Implemented basic functionnality in https://github.com/romgrk/termrk/tree/project-switch-option. Current implementation:

But I'd need to know which package specifically you're using, it might have different effects depending on the project-manager package.

ghost commented 8 years ago

No problem and thanks! I'm currently using atom-project-plus. If the project packages are well behaving, I would expect all of them to trigger atom.project.onDidChangePaths handlers when changing projects and your handler of this event to work properly with all the packages, but it never hurts to test, of course.