IceWM Address Bar

Forum Forums New users New Users and General Questions IceWM Address Bar

  • This topic has 16 replies, 6 voices, and was last updated Mar 26-11:46 am by oops.
Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #46475
    Member
    fladd

      There are two bugs in relation to the IceWM Address Bar:

      1. The documentation says that it supports completion using <Tab> or <Ctrl-I>, but none of those works
      2. The documentation says that running the entered command with <Ctrl-Enter> will run the command in a terminal. However, running any command with <Ctrl-Enter> seems to always open Claws mail for some reason

      #46476
      Anonymous
        Helpful
        Up
        0
        ::

        Regarding the documentation, it will be helpful to know whether the misinfo was stated in a (perhaps outdated) antiX-provided doc, or something stated in the docs authored by the upstream iceWM author?

        #46479
        Moderator
        BobC
          Helpful
          Up
          0
          ::

          I went to the IceWM website and in the manual they said:

          
          
          Ctrl+Alt+Space
          
          Activate the AddressBar. This is a command line in the taskbar where a shell command can be typed. Pressing the Enter key will execute the command. If AddressBarCommand was configured it will be used to execute the command otherwise /bin/sh is used. If the Control key was also pressed then the command is executed in a terminal as given by TerminalCommand. The address bar maintains a history which is navigable by the Up and Down keys. A rich set of editing operations is supported, including cut-/copy-/paste-operations and file completion using Tab or Ctrl-I.
          

          So try Ctrl+Alt+Space

          It would be good to know where its wrong so we can get it fixed.

          #46504
          Member
          fladd
            Helpful
            Up
            0
            ::

            Maybe I was not clear. Let me try again:

            1. I open the AddressBar with Ctrl+Alt+Space
            2. I type “python my_script.py”
            3. According to the documentation (see the quote by BobC above), I run this command then by hitting Ctrl+Enter, as this will run the command in a terminal.

            However, what happens in Antix is that this will close the AddressBar and open Claws Mail for some reason. This is a bug.

            In addition to that, according to the documentation (again, see the quote by BobC above), I should be able in step 2 above, to just type “python my_” and then hit TAB (or Ctrl-I) in order for the filename “my_script.py” to be completed. However, in Antix, this does not work. Hitting TAB (or Ctrl-I) does NOT complete the filename (it does nothing in fact). This is another bug.

            #46506
            Moderator
            BobC
              Helpful
              Up
              0
              ::

              Ok, that is clearer. Yes, I can confirm it doesn’t work on mine, either. It didn’t open Claws Mail on mine, though.

              I’d need to find someplace it does work to make sense of it. I’ve never had a use for it myself.

              #46507
              Member
              fladd
                Helpful
                Up
                0
                ::

                Did you run with Ctrl+Enter (and not just Enter alone)?

                I can make the first bug go away by replacing the following line in ./.icewm/preferences:

                TerminalCommand="desktop-defaults-run -t"

                with:

                TerminalCommand="roxterm"

                So it appears that desktop-defaults-run -t opens Claws Mail, but only when called from the IceWM AddressBar. Calling desktop-defaults-run -t from a terminal, will correctly open another terminal.

                #46509
                Member
                fladd
                  Helpful
                  Up
                  0
                  ::

                  Okay, the reason for the first bug is in the following comment above where you set the TerminalCommand in the preferences (line 649):

                  # Terminal emulator must accept -e option.

                  The command “desktop-defaults-run -t”, when given the “-e” option, will apparently translate to running “desktop-defaults-run -e”, which opens Claws Mail.

                  Hence, you have to explicitly set a terminal emulator as TerminalCommand! You cannot use this desktop-defaults-run thingy there, as this does not work.

                  That still leaves us with the second bug, namely that completion does not work. Any ideas on that?

                  #46515
                  Forum Admin
                  anticapitalista
                    Helpful
                    Up
                    0
                    ::

                    I get completion to work when the script/app is in one of the usual places eg /usr/local/bin, /usr/bin, but not when it is in /home/username.

                    Thanks for finding the fix to the first bug. Perhaps x-terminal-emulator would be a better than roxterm though.

                    • This reply was modified 2 years, 5 months ago by anticapitalista. Reason: fix typos

                    Philosophers have interpreted the world in many ways; the point is to change it.

                    antiX with runit - leaner and meaner.

                    #46516
                    Member
                    fladd
                      Helpful
                      Up
                      0
                      ::

                      Interesting. I also got a reply on an issue in their GitHub repo: https://github.com/ice-wm/icewm/issues/33

                      #46517
                      Forum Admin
                      anticapitalista
                        Helpful
                        Up
                        0
                        ::

                        I get what you wrote in your last post over at the IceWM github repo.
                        It does seem a bit limited.

                        I have to type antixcc. before it autocompletes to antixcc.sh but only cla for claws-mail to open.

                        Philosophers have interpreted the world in many ways; the point is to change it.

                        antiX with runit - leaner and meaner.

                        #46520
                        Anonymous
                          Helpful
                          Up
                          0
                          ::

                          per BobC’s quote, the docs state “If AddressBarCommand was configured it will…”

                          antiX ships an icewm preferences file containing
                          # AddressBarCommand = “”
                          Not specific to the “bug” at hand, perhaps the stock preferences file should NOT outcomment that line and, instead, specify =/bin/bash

                          After tracing through the iceWM v1.9.2 source code…
                          addressbar.cc
                          AddressBar::appendCommand()
                          ywordexp.h
                          wordexp.h (locally installed)
                          leafpad /usr/include/wordexp.h
                          …I’m not convinced the icewm doc should claim that its addressbar provides functionality beyond “command completion”

                          If posix wordexp truly provided “file completion”, why does the “bash completion” component exist?

                          Anyhow, setting addressbar to /bin/bash only governs which shell interpreter will be invoked when the Enter key is pressed from within icewm’s addressbar. The keystroke-by-keystroke event handling is still (only) handled by wordexp.

                          I believe the docs should be amended to state that the addressbar is capable of only command completion.

                          #46521
                          Member
                          fladd
                            Helpful
                            Up
                            0
                            ::

                            antiX ships an icewm preferences file containing
                            # AddressBarCommand = “”

                            Just to be clear, this thread is about running commands with Ctrl+Enter, which calls TerminalCommand. AddressBarCommand I think is only called when running commands with Enter.

                            perhaps the stock preferences file should NOT outcomment that line and, instead, specify =/bin/bash

                            If I understand correctly, then if not configured it will be /bin/sh, which should be fine as well.

                            After tracing through the iceWM v1.9.2 source code…
                            addressbar.cc
                            AddressBar::appendCommand()
                            ywordexp.h
                            wordexp.h (locally installed)
                            leafpad /usr/include/wordexp.h
                            …I’m not convinced the icewm doc should claim that its addressbar provides functionality beyond “command completion”

                            If posix wordexp truly provided “file completion”, why does the “bash completion” component exist?

                            Anyhow, setting addressbar to /bin/bash only governs which shell interpreter will be invoked when the Enter key is pressed from within icewm’s addressbar. The keystroke-by-keystroke event handling is still (only) handled by wordexp.

                            I believe the docs should be amended to state that the addressbar is capable of only command completion.

                            Interesting. I wonder how easy it would be to add full completion functionality to IceWM, given that that bash completion (or an alternative) is already available on most systems.

                            • This reply was modified 2 years, 5 months ago by fladd.
                            • This reply was modified 2 years, 5 months ago by fladd.
                            #46524
                            Anonymous
                              Helpful
                              Up
                              0
                              ::

                              https://man7.org/linux/man-pages/man3/wordexp.3.html

                              
                                 The expansion
                                     The expansion done consists of the following stages: tilde expansion
                                     (replacing ~user by user's home directory), variable substitution
                                     (replacing $FOO by the value of the environment variable FOO),
                                     command substitution (replacing $(command) or <code>command</code> by the output
                                     of command), arithmetic expansion, field splitting, wildcard
                                     expansion, quote removal.
                              #46527
                              Moderator
                              BobC
                                Helpful
                                Up
                                0
                                ::

                                I’m trying to figure out the purpose of having an address bar. On my totally stock setup it does open claws mail.

                                #46530
                                Anonymous
                                  Helpful
                                  Up
                                  0
                                  ::

                                  this thread is about running commands with Ctrl+Enter, which calls TerminalCommand.

                                  IIRC, antiX versions prior to 17 had associated roxterm with “desktop-defaults-run -t”
                                  then, for antiX17 it switched, to lxterminal… and has switched again to roxterm for antiX19.

                                  desktop-defaults-run -t
                                  consults the Exec= line in “terminal.desktop”

                                  In antiX17, that line (in the etc/skel default copy) stated Exec=lxterminal
                                  Now, in antiX19, that line (in the etc/skel default copy) states Exec=roxterm

                                  Each terminal emulator has quirks/differences in how they expect any launchstrings containing commandline options to be \\escaped\\ when passed to them.

                                  $grep -r ‘desktop-defaults-run -t[^e] [^m][^a][^n]’ /usr/local/*
                                  ^—–v
                                  The ‘desktop-defaults-run -t’ passthrough mechanism hasn’t seen much use except for launching a terminal emulator to display manpages, and may not be a suitable choice for icewm’s AddressBarCommand=

                                Viewing 15 posts - 1 through 15 (of 17 total)
                                • You must be logged in to reply to this topic.