excalibur1234 / pacui

Bash script providing advanced Pacman and Yay/Pikaur/Aurman/Pakku/Trizen/Pacaur/Pamac-cli functionality in a simple UI
GNU General Public License v3.0
168 stars 13 forks source link

string "Enter string to filter list" prevents typing on small terminal windows. #35

Closed freed00m closed 6 years ago

freed00m commented 6 years ago

When the term widow is too short I can't search for anything because it allows me to type only few characers.

In this example I could only type the letter "r", because that was the only letter that would fit the screen.

2018-03-21-205219_516x308_scrot

The easiest help would be just to replace the 'Enter string to filter list' with just 'Filter' ? Or maybe collapsing the entire string when the width is really small.

I use suckless terminal just if my problem is not reproducible on other terminals.

excalibur1234 commented 6 years ago

since https://github.com/excalibur1234/pacui/issues/30, the issue you are describing should almost never happen. instead, the preview window should be shown at the bottom in terminal windows narrower than 120 columns.

the only way i could recreate your screenshot was this way:

  1. run 'pacui l' in a wide terminal (more than 120 columns)
  2. decrese terminal width. now pacui looks the same as in your screenshot.
  3. when you run 'pacui l' again (in the narrow terminal window), the preview window is properly shown at the bottom.

you can check your terminal width with this command: tput cols

freed00m commented 6 years ago

Ok imagine I am using tiling window manager and my terminals change tput cols all the time. If the program could easily work in smaller terminal window, why not shorten the string?

excalibur1234 commented 6 years ago

in the beginning, the string was really short. the problem are beginners, who do not know how pacui is supposed to be used. they feel lost without visible instructions. a good example is this: https://www.youtube.com/watch?v=37btu107u7E i hate programs without visible instructions myself and can feel their pain. this is the reason i still like nano more than other terminal text editors.

as a reaction to the video above, i have added a gif demonstrating a basic use case of pacui to the github page. i have also tried to make descriptions as clear as possible. i have already shortened pretty much all stings to be uncomfortably short. i do not want to shorten them even further. if you have any suggestions how to shorten strings in pacui without losing information, i am all ears.

freed00m commented 6 years ago

Ok

I get it where you coming from and willing to accept this I was just sometimes puzzled why my typed search got eaten by just terminal resize.

My first idea would be a input box that would have this full string inside and would disappear right after user starts to type something. Maybe draw a box around it as well or just simply > string <.

Also the padding from the top changes when the terminal is short enough.

excalibur1234 commented 6 years ago

i am using fzf here. this means i am limited by fzf.

you can see the full fzf command (with comments and in the cleanest way i can present it) here: https://github.com/excalibur1234/pacui/blob/master/pacui#L441 (line 441 to 489) similar fzf commands in the rest of the code are convoluted and not presented as nicely as here.

the text you are looking for is in the --prompt and --header arguments. there is also --margin and --preview-window. you can look these arguments up in fzf's man page whenever fzf offers better ways of displaying text, i want to use them.

freed00m commented 6 years ago

From unknown date, the windows is now displayed at bottom and not left, without me changing anything. So I am closing this :+1:

2018-05-20-172158_802x482_scrot

excalibur1234 commented 6 years ago

good news: in the next version of fzf, your problem might be fixed.

take a look at this commit: https://github.com/junegunn/fzf/commit/0edbcbdf1909a6d3c56ae264362f11bc2bf9f65d