-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tab titles now show cwd (#2907) #3015
Tab titles now show cwd (#2907) #3015
Conversation
lib/utils/fs.js
Outdated
if (path) cwd = path[0]; | ||
} | ||
} else { | ||
cwd = execSync(`lsof -p ${pid} | awk '$4=="cwd"' | tr -s ' ' | cut -d ' ' -f9-`, {encoding: 'utf8'}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the best way to get the current CWD? 🤔 I wonder if there is an async way of doing it so we don't lock up the app...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@albinekb There are async methods of running child_processes, but I thought in Redux making stuff async is frowned upon (still learning, I've heard of thunks being used for async actions).
That's why I only have this function run when the user hits the enter key. I have been using my own custom dist from my fork and there seems to be no discernible performance impact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be executed each time that '\n' is output in term. Do not execute yes
in your fork 😁
This is not the right approach. BTW I'm using But feel free to make a plugin with your work 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the right approach.
If I had it read the |
@El-Dringo-Brannde willing to pick this up again? |
Closes #2907 #2886 #1188
This PR is ready to be merged, ran dist build and it works all the same on my Mac.
However, I don't have a PC, or a VM of a PC to test the windows pathing on. Theoretically... It should work as I have kindly borrowed the same code that gets CWD from hyper-statusline