Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Support cwd in replace pattern #1

Open
kbjr opened this issue Jun 30, 2018 · 6 comments
Open

Support cwd in replace pattern #1

kbjr opened this issue Jun 30, 2018 · 6 comments
Labels
enhancement New feature or request windows This is specific to Windows support

Comments

@kbjr
Copy link
Owner

kbjr commented Jun 30, 2018

I dug around for quite some time looking at wmic and handle and couldn't find a way to get this info on a Windows system, so it may not be an easy thing to accomplish cross-platform.

But having the ability to add a \d escape for current directory would be really nice.

@kbjr kbjr added the enhancement New feature or request label Jun 30, 2018
@kbjr kbjr added the windows This is specific to Windows support label Jul 11, 2018
@ghost
Copy link

ghost commented Dec 9, 2018

@kbjr this would be awesome if you could get that implemented, it cant be impossible, if its a node thing, you could use process.cwd() but not sure how terminus is running, haven't looked into the code too much. Still, this would be a great feature if you could get it working.

@kbjr
Copy link
Owner Author

kbjr commented Dec 9, 2018

The problem is that the "currently navigated to directory" is not the same as the cwd of the process. The shell itself keeps track of where you are in whatever way it deems to do that. Which means if there is a solution, it's likely different from shell to shell, and possibly just can't be done for some shells (powershell seems particularly opposed to letting me at that info).

@ghost
Copy link

ghost commented Dec 12, 2018

@kbjr Interesting, perhaps this is a bug to raise in the main terminus repository or have you done this already?

@Eugeny
Copy link
Contributor

Eugeny commented Jun 30, 2019

Current working directory can be retrieved with BaseTerminalTabComponent.session.getWorkingDirectory(): http://ajenti.org/terminus-docs/terminal/classes/basesession.html#getworkingdirectory

@kbjr kbjr mentioned this issue Jun 30, 2019
@kbjr
Copy link
Owner Author

kbjr commented Jun 30, 2019

Yeah, definitely still doesn't work on powershell (doesn't seem to work on WSL ubuntu either), but I'll leave the flag in there on the beta branch for now, and hopefully it works for other platforms (don't have a mac on hand to test, unfortunately).

@Eugeny
Copy link
Contributor

Eugeny commented Jun 30, 2019

Yep - macOS and Linux work perfectly, but Windows doesn't expose other processes' CWD, so Terminus relies on path being either printed with the prompt, or reported via ESC 1337: https://github.com/Eugeny/terminus/wiki/CWD-reporting

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request windows This is specific to Windows support
Projects
None yet
Development

No branches or pull requests

2 participants