[erlang-questions] How to disable parentheses matching in Erlang shell?

Sverker Eriksson sverker.eriksson@REDACTED
Fri May 20 12:32:57 CEST 2016


I don't think this problem has anything to do
with your application.

It think it has to do with the OS, the kind of terminals,
where run_erl and to_erl are started, and their window

And it's not connected to parantheses matching per se
but rather getting beam, run_erl and to_erl to agree
on the window width and how to move to get the terminal
to correctly move the cursor up and down. I tested with
Ctrl+A and Ctrl+E and verified if it correctly jumped
between start and end of the command line.

I did another commit that you can try

git fetch https://github.com/sverker/otp sverker/ttsl_drv-move-down

But to get this right I think some work needs to be done
to get to_erl to use the same terminal settings as run_erl
for example. It's on the todo list.

/Sverker, Erlang/OTP

On 05/17/2016 07:55 PM, Grzegorz Junka wrote:
> Sverker, I have a simple application which you could quickly compile 
> to be able to easily reproduce this issue. Just execute those steps 
> (one by one):
> mkdir test_sc
> cd test_sc/
> git clone https://github.com/builderl/ex1_simple_cache.git
> cd ex1_simple_cache/
> gmake get-deps
> gmake dev
> ./bin/init.esh
> ./bin/start.esh
> to_erl ../sc-1/shell/
> This will pull an application, get all its dependencies, compile, 
> install, configure, start and connect to one of the running nodes 
> (there will be two running nodes from the same release).
> I hope that will be helpful but of course I am happy to recompile the 
> OTP from your branch and retry if needed.
> Grzegorz
> On 17/05/2016 17:01, Grzegorz Junka wrote:
>> :(
>> As soon as I closed the bracket after typing {e, 5} from my example 
>> the cursor jumped some 10 columns to the right and then to the 
>> beginning of the line. That's how far it got (without the fix the 
>> cursor would jump incorrectly only after closing ']').
>> (sc-1@REDACTED)1> lists:sort([{a, 1}, {b, 2}, {c, 3}, 
>> {d, 4}, {e, 5}
>> Grzegorz
>> On 17/05/2016 13:10, Sverker Eriksson wrote:
>>> Could you test this fix and see if it makes the cursor behave
>>> when connected with to_erl/run_erl.
>>> git fetch https://github.com/sverker/otp sverker/ttsl_drv-move-down
>>> /Sverker, Erlang/OTP
>>> On 05/15/2016 11:45 PM, Grzegorz Junka wrote:
>>>> I just realized what is likely causing the problem. When I start 
>>>> the shell with erl and type in this testing string (with spaces so 
>>>> it's longer) it all works fine:
>>>> lists:sort([{a, 1}, {b, 2}, {c, 3}, {d, 4}, {e, 5}, {f, 6}, {g, 7}, 
>>>> {h, 8}, {i, 9}, {j, 10}]).
>>>> But I very rarely use Erlang shell in this way. Most of the time I 
>>>> am connecting to running Erlang nodes using to_erl specifying the 
>>>> shell's PID. Then it breaks, probably because my terminal size 
>>>> doesn't match the default terminal size with which the shell has 
>>>> been originally started.
>>>> When I then try to type in the same example the shell will match 
>>>> each {} correctly but as soon as I type ']' to close the list the 
>>>> cursor jumps to the line above, then some other place when I type ')'.
>>>> So it's not related to the environment but to the way I am using 
>>>> Erlang shell. Is there any solution to that?
>>>> Grzegorz

More information about the erlang-questions mailing list