WinGDB includes remote terminal implementation, allowing quick access to target Unix / Linux machines via SSH. The window is similar to popular SSH clients (e.g. Putty), however it is WinGDB's own implementation of a x-terminal, integrated into Visual Studio as a document window. Currently it emulates vt100 terminal only, but enhanced xterm mode is also in preparation.
In order to open new terminal window, you have to configure a connection first. Choose Open remote shell... option from WinGDB main menu to open the connection manager. Inside the connection manager, you can choose the connection you want to open. You can also add or remove connections, or edit their parameters.
Clicking New session or Edit session buttons opens a dialog allowing you to edit the parameters. The most basic parameters are connection name, target host name (or address), port (defaults to standard SSH port equal to 22) user account name and password. The password is optional. If you specify it, the password will be stored in encrypted form and not shown explicitly on screen. You will not have to enter it every time when opening the connection. You can also leave this field empty for even more security. WinGDB will then ask you for a password when connecting. You will also have an option to use Agent authentication method. The latter one is described here.
In order to open chosen connection, click Connect button it or just double-click connection on the list. If connecting and authenticating process succeeds, the terminal window will be opened. In case of error, there will be error message instead.
When terminal window is open, you can use it just as every other terminal emulation software. It emulates vt100/xterm pretty closely, although not yet as perfectly as Putty. However, typical console programs like Midnight Commander, top, man, etc. should work without problems.
You can also use additional features accessible from the context menu (click right mouse button over the window to show it). These options are:
You can configure font used in terminal windows as well as colors. These settings are separate from Process console settings, you can have different look for terminals and consoles.
To open configuration dialog, either use Show terminal preferences option on terminal window itself (caution: it will change settings for all terminal windows), or Preferences option from WinGDB main menu. In second case, choose Remote terminal category from the list on the left.
Remote terminal in WinGDB emulates fixed-size text window, as this is what typical Un*x program expects. Being fixed size, there is no direct possibility to scroll the window upwards, in order to see old lines of text that already have been moved out of the window. Typical terminal emulators address this problem by providing a scrollback buffer. This is an area of additional lines, logically placed above the console area. When the terminal encounters a newline character requiring it to scroll its entire contents upwards, the topmost line is stored in the scrollback buffer, instead of being discarded. This way you can have both fixed-size terminal emulation, and a possibility to examine lines of text printed earlier.
In order to use the scrollback buffer in the remote termninal, do one of the following:
The contents of the window will scroll, showing lines of text printed earlier (or blank space if there were no text yet).
Note that the scrollbars placed next to the window do not engage the scrollback buffer. They are for different purpose -- when the window is resized to be smaller than emulated fixed-size terminal window, you can use the scrollbars to view different parts of it.
WinGDB by default allocates 1000 additional lines. The limit is necessary to avoid exhausting memory when debugged process prints large amounts of data over prolonged time. You can change this amount in WinGDB Preferences, on the Terminal page. This change will be reflected in subsequently opened terminal windows.
Each configured connection has its description file. These files have XML format, .wingdbs extension and are stored in WinGDB configuration directory. For example:
C:\Users\All Users\WinGDB\Terminal\MyConnection.wingdbs
You can exchange connection files between machines. Passwords (if provided) are stored in encrypted format.
In environments like Visual Studio, there is a conflict between possible usages of Control key: whether use it in Visual Studio (allowing VS shortcuts), or send it to the terminal (allowing application shortcuts). WinGDB solves it by distinguishing left and right Control key: