henrikruscon / hyper-statusline

Status Line Plugin for Hyper
MIT License
387 stars 79 forks source link

update CWD when user press enter key #17

Closed elmasse closed 7 years ago

elmasse commented 7 years ago

The current implementation only updates the CWD when Session is activated (by switching tabs or clicking on the terminal). The interval function is keeping wrong data since it is not updating the CWD value. This small change listens to user data and will perform a CWD update when the user hits enter key. Also, maybe the setInterval can be completely removed with this change.

elmasse commented 7 years ago

related to #14

henrikruscon commented 7 years ago

It was also checking for title updates but this addition makes it more reliable on different setups without being too heavy. Thanks 👊

Interval is merely updating the UI with current data every 150 ms. It's not actually doing any fetching.

elmasse commented 7 years ago

@henrikdahl Thank you for accepting the PR! 👊 I was thinking a bit more on the setInterval; it might be useful to keep track of git information and update the component (the current pid and cwd will be always updated when the session is activated). But probably that can be discussed on a different thread. Again, thanks for this cool plugin! Max