Skip to main content

Settings

How to set up working directory detection?

When you cut from the terminal interface to file management, the file manager will automatically open the current directory of the terminal. This function needs to be configured by ourselves. The following are the configuration steps.

  1. Bash
vim ~/.bash_profile
export PS1="$PS1\[\e]7;CurrentDir="'$(pwd)\a\]'
  1. Zsh
vim ~/.zshrc
precmd () { echo -n "\x1b]7;CurrentDir=$(pwd)\x07" }

How to hide ip address in the sidebar?

in Settings dialog,just toggle the button

How to make host connection alive all the time?

Linux SSH close connection after sometime. ssh idle timeout.

What is an idle SSH session?

Here we mean that a ssh connection was made between a host and a client but there has been no activity on this connection by the user and is considered idle. Here although the ssh session is not in stuck state. You can list all the active ssh connections and then check the idle time for individual source host.

The trick to disconnect idle SSH session is to use below two arguments with proper values to achieve both the scenario i.e. to disconnect an idle SSH session and also to make sure your SSH session does not gets disconnected when idle

  1. ClientAliveInterval
  2. ClientAliveCountMax

From the man page

ClientAliveCountMax
Sets the number of client alive messages which may be sent without sshd(8) receiving any messages back from the client. If this threshold is reached
while client alive messages are being sent, sshd will disconnect the client, terminating the session. It is important to note that the use of client
alive messages is very different from TCPKeepAlive. The client alive messages are sent through the encrypted channel and therefore will not be
spoofable. The TCP keepalive option enabled by TCPKeepAlive is spoofable. The client alive mechanism is valuable when the client or server depend
on knowing when a connection has become inactive.

The default value is 3. If ClientAliveInterval is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds.

ClientAliveInterval
Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client.

Disconnect idle SSH session (ssh close connection after sometime)

To disconnect idle SSH session i.e. to ssh close connection after some time make sure ClientAliveCountMax is 0. Because when is 0, sshd will not send client alive messages and ssh close connection after sometime if client is inactive for time period as provided with ClientAliveInterval.

Keep idle SSH session active

We already know how to disonnect SSH sesion,Now if this is becoming a problem for you then you can increase the value of ClientAliveCountMax to a non-zero value. Additionally you can also use TCPKeepAlive in your sshd_config on the client node. From the man page of sshd_config:

TCPKeepAlive
Specifies whether the system should send TCP keepalive messages to the other side. If they are sent, death of the connection or crash of one of the
machines will be properly noticed. However, this means that connections will die if the route is down temporarily, and some people find it annoying.
On the other hand, if TCP keepalives are not sent, sessions may hang indefinitely on the server, leaving "ghost" users and consuming server
resources.

The default is yes (to send TCP keepalive messages), and the server will notice if the network goes down or the client host crashes. This avoids in‐
finitely hanging sessions.

To disable TCP keepalive messages, the value should be set to no.

Nex Terminal supports the TCP KeepAlive function, allowing you to conveniently set the Keep Alive Interval directly within the settings dialog.