How to send keystrokes to different (multiple) sessions
Xshell can apply keystrokes or quick command executions to the current session, certain sessions, or all sessions.
- Simultaneous input through the Compose Bar or Compose Pane
- Run a Quick Command simultaneously through the Compose Bar or Compose Pane
- Simultaneous input through the Send Key Input to All Sessions function
Simultaneous input through the 'Compose Bar' or 'Compose Pane'
The 'Compose Bar' and 'Compose Pane' are spaces where a user can compose commands or strings before directly entering the into the terminal and sending them to the server. The 'Compose bar' is used to send a single line of command or string to the remote server. The 'Compose Pane' has the same role as the 'Compose Bar', but you can draft and edit multiple lines and send them at once.
- In the'View' menu, select 'Compose' =>'Compose Bar' or 'Compose Pane'
- Select the range to send commands from the range selection icon on the left of the 'Compose Bar' or 'Compose Pane'.
- Enter a string in the 'Compose Bar' or 'Compose Pane' and press the Enter key.
Simultaneous execution of Quick Commands through the 'Compose Bar' or 'Compose Pane'
Quick Commands are a function that allow you to register and execute frequently used commands or scripts with a button. Depending on your preference, you can select the 'Quick Command Bar' or 'Quick Command Pane', or both.
- Select "Quick Command Bar" or "Quick Command Pane" from 'Quick Commands' in the 'View' menu. You also need to open the 'Compose Bar' from the 'Compose' menu.
- Create a Quick Command you want to execute in the 'Quick Command Bar'. You can create a Quick Command from the left menu icon of the 'Quick Command Bar' or by double-clicking the bar.
- Click OK to save. Navigate to the 'Compose Bar' and select the range.
- After pressing the Quick Command button you want to execute, check that the command is entered into the compose bar. If it contains a newline character, the command is executed immediately, and you can see that the command is delivered to all of the selected areas.
Simultaneous input through the 'Send Key Input to All Sessions' function
This is a function that takes all of a user's terminal input and enters it simultaneously across all sessions selected by the user. One advantage of this option over the others is that you can send the ESC key, Backspace key input, or various combination keys with Ctrl, Alt key, etc., which are difficult to do through the 'Compose Bar' and 'Compose Pane'.
- From the 'Tools' menu, select the 'Send Key Input to All Sessions' menu.
- The status is displayed at the top of each session where simultaneous input will be executed. To exclude a session, simply press the 'Off' button.
- Input in a session is applied simultaneously to all sessions where simultaneous input is in effect.