When I SSH to a VM and start confconsole, and something goes wrong, or there are some "for more information go to <URL>..." I would very much like to be able to select said text to be able to 

  • post the error message here
  • paste the selected text (e.g. URL) to my browser and not need to type it in
  • in general feel less like a moron who is bossed around

So do you think it would be possible to make confconsole (what is it - ncurses?) behave like every other text-based UI in the known Unixverse?

My sanity would appreciate it very much.

 

Forum: 
Jeremy Davis's picture

For background, Inithooks and Confconsole are both python apps and both use the python3-dialog library to leverage the dialog (upstream website) application to create the interactive CLI dialog boxes. Prior to v16.0, we were using our own (old and unmaintained) fork of these programs, but as of v16.0, TurnKey now uses the default packages provided by Debian.

By my understanding, at least in theory both copy and paste should work.

Having said that, I just SSHed into a server that I have handy and I can't easily just select a small amount of text. Using my terminal menu bar, I can "select all" and then "copy". It works pretty much exactly as you'd expect, it copies the whole contents of the terminal window and copies it as text. I can then paste that text into another window and it's all there. But I get that's not ideal and not really what you are asking for.

As for pasting, that part works fine. Although I do need to ensure that the cursor is in the input box and I need to use my terminal's menu to "paste".

For what it's worth, I run Debian (Buster) with Gnome3 desktop; Gnome's default terminal emulator with OpenSSH's default commandline ssh-client. I was logging into a TurnKey v16.x server that I had handy.

Out of interest, I installed Confconsole on my desktop too and within the Gnome terminal, the behaviour is identical. Out of interest though, I did notice that whilst the mouse can't be used to select text, it can be used to select options (hover and click). I tested that within an SSH session and that works exactly the same... Further, I install rxvt (a very popular terminal emulator) and tested that, as well as the default xterm and both of these display the same behaviour, so I can only assume that it's actually dialog that is doing that (not the terminal nor ssh-client).

I have read through the dialog man page in depth and the only note regarding mouse that I found, was the '--no-mouse' option. On face value that didn't seem to be relevant, but on further pondering, I think that may be it. I'm a vim user but still use my mouse a fair bit and to allow vim to support mouse select (and therefore copy/paste) you need to disable vim's mouse awareness.

And I just tested that and guess what?! It works! Yay! :)

So to Confconsole, I just did a quick and dirty test and added the "--no-mouse" switch to 'confconsole.py':

--- /usr/lib/confconsole/confconsole.py.bak	2020-12-08 16:25:29.807791022 +1100
+++ /usr/lib/confconsole/confconsole.py	2020-12-08 16:26:20.292878246 +1100
@@ -73,6 +73,7 @@
         self.console.add_persistent_args(["--ok-label", "Select"])
         self.console.add_persistent_args(["--cancel-label", "Back"])
         self.console.add_persistent_args(["--colors"])
+        self.console.add_persistent_args(["--no-mouse"])
         if title:
             self.console.add_persistent_args(["--backtitle", title])

And it works! :)

Long and the short of it is, thanks for reporting this. I've opened up a feature request (on our issue tracker) to add this to confconsole (and inithooks) and make it the default behaviour. I'm not sure when it will be released, but hopefully I'll upload a package that contains this change really soon so you can test it out yourself.

Add new comment