albertlauncher / albert

A fast and flexible keyboard launcher
https://albertlauncher.github.io
Other
7.29k stars 307 forks source link

Terminal Extension: Allow to disable the autocomplete #878

Closed kaleocheng closed 4 years ago

kaleocheng commented 4 years ago

Hi guys, thanks for building Albert, it works really well for me so far except a minor thing on Terminal Extension.

I have a alias v which is a wrapper of autojump + vim. I usually use it like

$ v workspace

then when I try to use it via terminal extension, there are tons of commands came from autocomplete and I have to jump to the last I'm Feeling Lucky one by one. image

so how can I disable that autocomplete?

Source

NixOS repo

Environment

        Albert version: 0.16.1
            Build date: Jan  1 1970 00:00:01
            Qt version: 5.12.3
  QT_QPA_PLATFORMTHEME: 
       Binary location: /nix/store/bgfnfvrw55ixngscw4jijf9gkwmfsk9m-albert-0.16.1/bin/.albert-wrapped
                   PWD: /home/kaleo/.config/albert
                 SHELL: /run/current-system/sw/bin/bash
                  LANG: en_US.UTF-8
      XDG_SESSION_TYPE: x11
   XDG_CURRENT_DESKTOP: 
       DESKTOP_SESSION: none+openbox
   XDG_SESSION_DESKTOP: none+openbox
                    OS: NixOS 19.09.2407.b67bc34d4e3 (Loris)
     OS (type/version): nixos/19.09.2407.b67bc34d4e3
             Build ABI: x86_64-little_endian-lp64
  Arch (build/current): x86_64/x86_64
 Kernel (type/version): linux/5.4.32
idkCpp commented 4 years ago

Currently I do not know of the possibility to disable autocomplete on the Terminal extension. It appears from https://github.com/albertlauncher/plugins/blob/dev/terminal/src/extension.cpp#L131 that the "lucky" item is also not subject to frequency reordering (it does not bubble up if used more).

I would suggest introducing a second trigger for the Terminal extension such as $. When this trigger is used, only the lucky item is returned. This can be easily implemented by putting the whole index search into an if block.

Anyone who would like to submit a PR is very welcome.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ManuelSchneid3r commented 4 years ago

We have come to a clear decision: aliases and functions are interactive shell features. Albert is no interactive shell so it wont support it. Also we are not going to loosen this restriction since parsing shell(s) rc files, profiles, xinit, logout and whatever files may be read at shell initialization is a major pita. You can still place a script in ~/.local/bin/.

Note: I wrote this comment as fast as I can to master the current pile of work. If I missed the point or you have other objections please open a new issue.