henrikruscon / hyper-statusline

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

current folder shows more than just current folder #37

Closed chrisdrackett closed 7 years ago

chrisdrackett commented 7 years ago

I'm getting something like the following:

https://cl.ly/3R2Q2S2K1M0x

henrikruscon commented 7 years ago

Interesting. Can I see your .hyper.js and your .zshrc?

chrisdrackett commented 7 years ago

I actually removed both of these files while debugging and I get the same behavior.

henrikruscon commented 7 years ago

I can't be much help unless I get more information ✌️

chrisdrackett commented 7 years ago

Yeah, just saying I pulled both those out of the running without luck. Where exactly is what is being displayed coming from?

henrikruscon commented 7 years ago

It's fetching CWD through this command:

const setCwd = (pid) => {
    exec(`lsof -p ${pid} | grep cwd | tr -s ' ' | cut -d ' ' -f9-`, (err, cwd) => {
        curCwd = cwd.trim();
        setBranch(curCwd);
    })
};

For some reason it appears to be returning false CWD which to me sounds impossible considering it should affect the entire terminal behavior 🤔

chrisdrackett commented 7 years ago

hm, what is pid in this case? (I'm in no way a terminal expert). When I type pwd I get the expected result, not sure if this is too simplistic for what this package is trying to do :D

chrisdrackett commented 7 years ago

ok, I think I've figured this out. The issue is that my username is cwd so the grep is finding everything. Not sure if there is an easy fix, and this only really affects me and maybe a very small number of users...