[erlang-questions] Line wrapping issue when attaching to running node

Camille Troillard lists@REDACTED
Tue Dec 23 16:00:57 CET 2014


Hello,

We are experiencing an annoying problem in integration or production environment that deals with incorrect line wrapping when connecting to a remote shell.

Erlang version:
Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false]

Installed on FreeBSD using the `erlang-17.3_3,3` package.


We generate a release using rebar. When we want to interact with it, we attach to the system like so (assuming the release is named “abc”) :

    $ ./rel/abc/bin/abc attach

    (abc@REDACTED)1>


In this situation, whenever you write something that exceeds the width of the terminal (typically 80 columns), the line wraps onto a second line, which is OK.  But if you have an open parenthesis on the first line, that is closed on the second line, then the output becomes garbled, text overwritten and it is no longer possible to sanely use the shell.

This is an example of expected output:

    (abc@REDACTED)1> this_is_an_example_of_a_long_module_name:call_this_function([1
    , 2, 3, 4], another_arg).

And the actual output (the cursor is on the first line at column 2):

    .abc@REDACTED, another_arg)an_example_of_a_long_module_name:call_this_function([1
    , 2, 3, 4]


Text garbling occurs as soon as I hit the first ‘]’. It also occurs on ‘)’.

It does not happen when typing into an erlang shell that was launched using `erl` directly. 

It seems to happen to_erl. The same erratic behaviour is seen when attach to a release running on FreeBSD or OS X.  It does not matter whether the console is running locally or via SSH.  Also, it does not seem to matter wether the TERM variable is set to ansi, vt100, xterm or xterm-256color.


I would like to know if someone noticed this problem, and how to fix it.

Thanks !
Camille




More information about the erlang-questions mailing list