fix: 🐛 Stop sending ssh command when session initiated in CLI (#1925)

✅ Closes: ICU-11209
This commit is contained in:
Zhihe Li authored and GitHub committed 2023-09-26 16:36:13 -04:00
1 parent f4768c69a5
commit f6e7529b38
2 files changed
+13 -4

No files matched your search

@@ -69,10 +69,14 @@ export default class SessionTerminalTabsComponent extends Component {
const { isWindows } = await this.ipc.invoke('checkOS');
const { model } = this.args;
// Don't send the command on windows as most users won't have an openSSH client installed
if (model.target?.isSSH && !isWindows) {
const { proxy_address, proxy_port } = model;
const { proxy_address, proxy_port, started_desktop_client, target } = model;
// Only send the command on certain scenarios:
// 1. Only for SSH targets
// 2. Don't connect for windows as most users won't have an openSSH client installed
// 3. Don't connect if the session wasn't initiated in the desktop client
// which means we won't have proxy information
if (target?.isSSH && started_desktop_client && !isWindows) {
// Send an SSH command immediately
window.terminal.send(
`ssh ${proxy_address} -p ${proxy_port} -o NoHostAuthenticationForLocalhost=yes\r`,
+6 -1
View File
@@ -5,11 +5,16 @@
const path = require('path');
const { isWindows } = require('../helpers/platform.js');
const isDev = require('electron-is-dev');
module.exports = {
// Returns boundary cli path
path: () => {
const name = isWindows() ? 'boundary.exe' : 'boundary';
return path.resolve(process.resourcesPath, 'cli', name);
// The CLI will be located in a different location once packaged up in an ASAR
return isDev
? path.resolve(__dirname, '..', '..', 'cli', name)
: path.resolve(process.resourcesPath, 'cli', name);
},
};