Use Terminal to make remote connections on OSX

When connecting to a remote machine on OSX, the system opens an xterm window to make the ssh connection to the remote machine. For this to work, you need to have XQuartz installed and running.

Not all users have XQuartz installed and running all the time. However, all Macs come with the Terminal program that can be used to run a shell script and interact with it. This is the solution that most applications on Mac use when they need to launch a shell script that might need user input. Using Terminal is a better solution.

ParaView is already using Terminal for the native SSH support, is this what you are reffering to ?

Are you sure? When I, for example, connect to summit, it pops up an xterm window, not a Terminal.app window, to run ssh in.

the executable to use can be overriden in the server configuration, so maybe that is why, but there is code to detect and use Terminal already:
https://gitlab.kitware.com/paraview/paraview/-/blob/master/Qt/Core/pqServerConfiguration.cxx#L470

xterm tunnels the connection from the ParaView server to the client. I am not sure if Terminal can do that. This may be the reason why we use xquarts - but I have not checked.

I know I tried to use the system ssh in Windows instead of putty, and it would just not connect even if it supports the same options. This is why we require putty in Windows.

It can, it depends only on ssh.

putty is required on windows because of this issue in windows OpenSSH implementation:

Hi Ken,
When I use my Mac to connect to chama, it uses a terminal. It does not use an xterm. Further, I don’t have an xterm loaded on my Mac. I.e., “xterm” fails with “command not found.” Note that we don’t use port forwarding. Call me if you want to see how we do it.

OK. That sounds like my bad. I was looking at some older tutorial slides that said XQuartz was needed and I observed it launching an xterm on my machine (where I already had XQuartz installed). If it actually launches Terminal when XQuartz is not installed, then this request is already implemented.

(I’m not sure how to close out the feature requests in discourse.)

Since this thread contains interesting information, I’ll just move it to another category.

1 Like

By the way, here is an example for the client side on a Mac:

<!-- NOTE - On a Mac, this goes in the root of the Mac ParaView tree, i.e., in Contents.   -->
<Servers>

 <Server name="Canyonlands" resource="csrc://canyonlands" owner="site" >
  <CommandStartup>
   <Options>
    <Option name="SSH_USER_NAME" label="User Login">
     <String default="username" />
    </Option>
    <Option name="NODES" label="Number of Nodes">
     <Range type="int" min="1" max="4" step="1" default="1" />
    </Option>
    <Option name="MINUTES" label="Number of Minutes">
     <Range type="int" min="1" max="60" step="15" default="60" />
    </Option>
   </Options>
   <SSHCommand exec="python3 /myDirectory/myServersidePythonScript.py" timeout="0" delay="5">
    <SSHConfig user="$SSH_USER_NAME$">
      <Terminal/>
    </SSHConfig>
     <Arguments>
      <Argument value="$NODES$" />
      <Argument value="$PV_CLIENT_HOST$" />
      <Argument value="$MINUTES$" />
     </Arguments>
   </SSHCommand>
  </CommandStartup>
 </Server>

</Servers>