6

When a line is longer than the current window width, Putty will wrap the line instead of showing a horizontal scroll bar. How can I prevent this behavior?

It's particularly annoying when using a MySQL client.

3

1 Answer 1

4

PuTTY, as noted, does not provide a horizontal scroll bar. It supports the VT100-style autowrap feature which may be confused for the ability to suppress line-wrapping. But it does not work that way:

  • applications running in a terminal generally use terminal descriptions (in termcap or terminfo format) to know how the terminal will behave.
  • for instance, these capabilities are listed in the terminfo(5) manual page.
  • the terminal descriptions include strings used by ncurses and other applications to initialize the terminal.
  • PuTTY's configuration dialog provides several features which can change its notion of the initial state.
  • a "complete" initialization string from the host (which does not make assumptions about the terminal's initial state) will override PuTTY's initial state.

The feature in terminfo is called "auto-margins", and is listed here:

   auto_right_margin         am     am   terminal has auto-
                                         matic margins

In Basic Capabilities, the manual notes

If the terminal wraps around to the beginning of the next line when it reaches the right margin, then it should have the am capability.

That is, it tells the application what to expect. If the application does not expect that the terminal will wrap it will assume that it does not, and move the cursor to simulate wrapping as needed.

As a general rule, terminal emulators provide configurable features that can be

  • put into an initial state
  • enabled
  • disabled

The last (disabled) is much less common than the first two. PuTTY's automargin feature lies in the first category. As noted in PuTTY wish horiz-scroll, if you really need horizontal scrolling, you will only get that by using an application running in the terminal emulator which simulates the feature. The example given (less) provides this using the -S option (see Use less -S for horizontal scrolling).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .