fix ssh url handling

This commit is contained in:
Labhansh Agrawal 2023-05-06 10:22:45 +05:30
parent 32447ade1b
commit 32eeb6d0cf
6 changed files with 8 additions and 12 deletions

View file

@ -292,12 +292,11 @@ export function leaveFullScreen(): HyperActions {
};
}
export function openSSH(url: string) {
export function openSSH(parsedUrl: ReturnType<typeof parseUrl>) {
return (dispatch: HyperDispatch) => {
dispatch({
type: UI_OPEN_SSH_URL,
effect() {
const parsedUrl = parseUrl(url, true);
let command = `${parsedUrl.protocol} ${parsedUrl.user ? `${parsedUrl.user}@` : ''}${parsedUrl.resource}`;
if (parsedUrl.port) command += ` -p ${parsedUrl.port}`;