Closed johnw42 closed 10 months ago
Hi @johnw42,
Thank you for your feedback. I have released version 1.1.10 to support relative paths in the "cwd" field.
Please upgrade and enjoy the new features. If you encounter any issues, please let me know.
Hi @nguyenngoclongdev
I noticed that relative paths still don't work.
I use v1.1.10
(Linux/Ubuntu and ZSH as Terminal) and I need to always set the entire path (e.g. /home/username/code/project/backend
)
Does this feature still not work or am I doing something wrong/what value do I have to insert there?
Hi @FabioKaelin
I tested on Ubuntu 22.04 (terminal-keeper v1.1.10) and it works correctly.
If you can, please share your terminal-keeper settings?
I'm using v1.1.11 and I still can't get the cwd field to work. I've tried in Windows and Ubuntu running in WSL. Here's my session file:
{
"$schema": "https://cdn.statically.io/gh/nguyenngoclongdev/cdn/main/schema/v8/terminal-keeper.json",
"theme": "tribe",
"active": "default",
"activateOnStartup": false,
"keepExistingTerminals": true,
"sessions": {
"default": [
{
"name": "test",
"autoExecuteCommands": true,
"cwd": "test",
"commands": [
"pwd"
]
},
{
"name": "data",
"autoExecuteCommands": false,
"cwd": "data",
"commands": [
"pwd"
]
}
]
}
}
Even if you can't reproduce the problem, I think a good workaround would be to use \n
to separate the commands instead of ;
. That way I can put a cd
command in the command list without it becoming part of the last item in the shell's command history.
@johnw42 I tried to find the problem and found multiple solutions that can help you. Please try the following: https://stackoverflow.com/questions/52397075/setting-wsl-to-cwd-in-vscode-terminal https://github.com/microsoft/WSL/issues/6995
It looks like the "cwd" field for a
terminalItem
only supports absolute paths, at least with PowerShell in Windows. If I try to use a relative path I get a message like this:I think it would be helpful to treat relative paths as being relative to the project root.
I can work around the issue by putting a
cd
command in "commands" and setting "autoExecuteCommands" to true, but then the ability to preload a command without executing it is impaired.