Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

toshiki

This solves the problem. Thank you!
toshiki

wt.exe ssh.exe !U@!@ -p !#  -t "cd '!/' \; DONTCD=1 \; /bin/bash --login"

I tried this command, but it seems that DONTCD is undefined when .bashrc is executed. If I echo $DONTCD in .bashrc, it's empty.
martin

I assume you can do something like this:
wt.exe ssh.exe !U@!@ -p !#  -t "cd '!/' \; export DONTCD=1; /bin/bash --login"

(edited)
And then in .bashrc don't do cd, when the DONTCD is set.
toshiki

Thank you. I don't get any error messages. I was logged in to the cluster and was put in the directory I specified in ~/.bashrc. I deleted the cd command in .bashrc and now it works. I guess this is the expected behavior?

The thing is, I've always been using PiTTY where it works even if I specify a starting directory in .bashrc. Now, I can get the desired behavior by changing my .bashrc, but then I won't be in the directory I want when I don't use WinSCP. Is there a way to make it work without modifying bashrc? Or I wonder if I can modify .bashrc in a way that distinguishes the two login scenario..
martin

Re: OpenSSH in Windows Terminal open in the same directory

Single quotes do work for me, like this:
wt.exe ssh.exe !U@!@ -p !#  -t "cd '!/' \; /bin/bash --login"

If it does not work for you, we need more details. What error/problem are you getting? What system are you connecting to?
toshiki

OpenSSH in Windows Terminal open in the same directory

Hi, I'm using WinSCP v6.3.1. I want to use OpenSSH in Windows Terminal and open it in the same directory. I followed this article (https://winscp.net/eng/docs/integration_putty#wt). However, it seems that the command there can't treat paths with spaces. The path seems to be truncated after the first space. I tried
"C:\Users\Arsci\AppData\Local\Microsoft\WindowsApps\Microsoft.WindowsTerminalPreview_8wekyb3d8bbwe\wt.exe" -w 0 ssh.exe !U@!@ -p !#  -t "cd '!/' \; /bin/bash --login"

i.e. adding single quotes. But it still doesn't work.