Open vphantom opened 2 years ago
What is the command that gets you this behaviour?
It's across the board. For example opam install sexp
will go right ahead and assume "yes" at the "13 to install, do you want to continue?" prompt.
if yes
is activated by --confirmlevel
, --yes
, or environment variable, you shouldn't have the prompt Do you want to continue?
$ opam install sexp
The following actions will be performed:
∗ install conf-g++ 1.0 [required by re2]
[...]
∗ install sexp v0.14.0
===== ∗ 73 =====
Do you want to continue? [Y/n] n
# I answer 'n'
$ opam install sexp --confirm-level=ask
The following actions will be performed:
∗ install conf-g++ 1.0 [required by re2]
[...]
∗ install sexp v0.14.0
===== ∗ 73 =====
Do you want to continue? [Y/n] n
# I answer 'n'
$ opam install sexp --confirm-level=yes
The following actions will be performed:
∗ install conf-g++ 1.0 [required by re2]
[...]
∗ install sexp v0.14.0
===== ∗ 73 =====
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⬇ retrieved async.v0.14.0 (https://opam.ocaml.org/cache)
⬇ retrieved async_kernel.v0.14.0 (https://opam.ocaml.org/cache)
[ERROR] User interruption
Weird. In my case I always see the prompt, but it is answered automatically. I can't seem to convince opam that I want interaction.
Reading the code for this, I think the issue is that somehow on your machine you’re hitting some kind of Unix exception https://github.com/ocaml/opam/blob/master/src/core/opamConsole.ml#L757 As to why, i have no idea. If you’re feeling up to it you can try adding logs to this function and see what breaks but without knowing what is different on your system I have no idea how to debug this.
By any chance, how did you install opam? Through the precomiled binaries/install.sh or something else?
I initially used the install.sh
but I think that for the upgrade to 2.1.0 I just downloaded the prebuilt binary from GitHub. A binary diff confirms that it's the binary I'm currently using.
Of note is that I use kitty as my terminal and do everything in tmux. I have the relevant files for both in my ~.terminfo/
. This was already the case when I used opam <2.1.0 and interactive prompts worked as expected.
I don't understand the instructions at that page. The "From Source" section doesn't mention any compiling step.
But yes if there's something I can A/B test vs 2.1.0 I'd be happy to help. 😃
It's normal that there is no compilation step. As you install everything with your opam, you don't need to compile things yourself :) I'll prepare you a branch to test then.
I can't figure out what I did to trigger this, or if it's actually a bug in 2.1.0, but
--confirm-level=yes
is assumed by default in my setup. If I use--confirm-level=ask
explicitly to try to get the old behavior, it incorrectly behaves as though I had specifiedyes
. If I use--confirm-level=no
however, thenno
is correctly assumed.I'm not running opam through a wrapper script which might make it think the tty is non-interactive.
Any ideas?