How to disable "Command is taking a long time..." in OTP28

Somewhat overdue I started to use OTP-28, and naturally one of the first things on the agenda was to run some QuickCheck tests. While doing so I was greeted with a new helpful message “Command is taking a long time, type Ctrl+G, then enter ‘i’ to interrupt”.

Not sure what the timeout is, but it seems to be less than 10 seconds.

I normally run tests for minutes, so no, it is not stuck, and no I don’t need this message. I couldn’t easily find (tried Google) how to disable it, hence my question?! (I can see that it could be useful in some cases, so having it on by default could be merited, but printing it on every long running operation is also questionable?)

This looks a bit silly:

7> test({30, s}).
...............................................................................................
.....(x10)..................................................................................
...............Command is taking a long time, type Ctrl+G, then enter 'i' to interrupt
...(x100).......................................................(x10)......(x1).......
Time limit reached: 30.0 seconds.

OK, passed 6667 tests
7 Likes

From shell.erl:

shell_rep(Ev, Bs0, RT, FT, Ds0) ->
    shell_rep(Ev, Bs0, RT, FT, Ds0, 5000).
shell_rep(Ev, Bs0, RT, FT, Ds0, Timeout) ->

Seems like it’s always set to 5 seconds and it can’t be overriden. Perhaps this could be exposed via env var, e.g. shell_command_timeout that defaults to 5 seconds? And to disable it, one can just set it to infinitiy

It seems to have been implemented here: Print hint for when shell is stuck by garazdawi · Pull Request #8793 · erlang/otp · GitHub I don’t see any discussion or motivation. Perhaps it was a little bit hasty, it can’t really be that important to spam people on every command, while not giving any option to disable it?

@garazdawi made the PR, so perhaps he can fill in the blanks, what was the reasoning?

@garazdawi Is on parental leave, so if you want a change send a PR to make this optional.

I had planned to work on a PR, and if Lukas is away I can see you need some help with such intricate code :sweat_smile: But it would be good to know the motivation behind why it was added in general, and in this way in particular. In the past I’ve worked on PRs where it turned out it had already been discussed and ideas was rejected. So I’d like to do this in the most efficient way.

As far as I can see the original PR wasn’t even reviewed properly, so perhaps there is little discussion to reveal?!

I haven’t heard any discussions ( but I’m in wrong team) but when I asked, his answer was roughly
“It is there to help newbies, we can change that if many complains” now many have complained :slight_smile:

I think it would be great if it is default on and we can remove it with some parameter.

Make shell hints configurable by hanssv · Pull Request #10121 · erlang/otp · GitHub makes it default to on, but easy to disable for more seasoned users.

3 Likes

@hanssv thanks for the PR.

somewhat related: is it possible to also turn off that annoying pager (e.g when doing: i()) as well?

As the code is currently written, it doesn’t look like it. Should be straightforward to do something similar to PR#10121 - are there many commands that have this paged output.

If you can trick io into returning infinity from io:rows/0 somehow it would solve the paging, but possibly that has other effects :see_no_evil_monkey:

That would break any code trying to reason about the terminal window, such as a terminal UI library.