Coder Social home page Coder Social logo

No help in hund filemanager about nextvi HOT 15 CLOSED

kyx0r avatar kyx0r commented on July 22, 2024
No help in hund filemanager

from nextvi.

Comments (15)

kyx0r avatar kyx0r commented on July 22, 2024

You are likely running it like :? in hund? Everything works on my side, just press '?' while you are in hund. Worst case scenario run xev and see if your keycode for "?" matches mine. By "virtual terminal" I assume you mean tty?
2020-12-09-133543-1366x768-scrot

from nextvi.

Vouivre avatar Vouivre commented on July 22, 2024

I simply press ? in hund. We are in the worst case scenario. When I press ?, I get from xev

KeyPress event, serial 32, synthetic NO, window 0x2400001,
root 0x1a0, subw 0x0, time 1420270, (1019,462), root:(1020,482),
state 0x1, keycode 20 (keysym 0x3f, question), same_screen YES,
XLookupString gives 1 bytes: (3f) "?"
XmbLookupString gives 1 bytes: (3f) "?"
XFilterEvent returns: False

With the help of xmodmap -pk I was able to find that keycode 61 is bound to -:

KeyRelease event, serial 32, synthetic NO, window 0x2400001,
root 0x1a0, subw 0x0, time 1538471, (998,407), root:(999,427),
state 0x0, keycode 61 (keysym 0x2d, minus), same_screen YES,
XLookupString gives 1 bytes: (2d) "-"
XFilterEvent returns: False

I mean tty with "virtual terminal". Now I will know the correct word, sorry!

from nextvi.

kyx0r avatar kyx0r commented on July 22, 2024

Well, this may be caused by some unusual keyboard you are using or some other system misconfiguration.

from nextvi.

Vouivre avatar Vouivre commented on July 22, 2024

I have a /etc/X11/xorg.conf.d/10-keyboard.conf file with the following:

Section "InputClass"
    Identifier "system-keyboard"
    MatchIsKeyboard "on"
    Option "XkbLayout" "ch"
    Option "XkbVariant" "fr"
EndSection

If I delete this file, I have the english keyboard and the keycodes are switched:

  • I get keycode 61 for question
  • keycode 20 for minus

But even with the english keyboard, it doesn't work. In hund I simply press ? and nothing happens. I'm not sure I need hund, so unless you have another idea, I will first check that I need hund. Probably the history buffer that you have implemented will be enough.

from nextvi.

kyx0r avatar kyx0r commented on July 22, 2024

Strange. Could you do me a favor and put printf("%s", (char*)buf); right there https://github.com/kyx0r/neatvi/blob/master/hund.c#L5967

Tell me what comes out, you can only see the printf output when you close vi, so after you press '?' just "qqqq". Also, does the '?' functionality in vi work correctly? It should do the reverse of what '/' does.

from nextvi.

kyx0r avatar kyx0r commented on July 22, 2024

Also, what is your locale set to ? Check the output of locale Just changing that xorg conf might not do it, since I am not very convinced that X11 controls what the terminal reads. I come to think that just setting your locale might be the bingo, so for example run export LANG=C and see if that fixes it. Ofc you don't have to change your entire system locale if that's the case, you can just put that export command in your zshrc and it will be only for terminals.

from nextvi.

Vouivre avatar Vouivre commented on July 22, 2024

? is the reverse of / in vi, so it works correctly. I have change like the following:

    } while (rd < 0 && errno == EINTR && errno == EAGAIN);
FD_CLR(fd, &rfds);
printf("%s", (char*)buf);
return rd;

And after quitting vi, it prints

?qq%

perhaps % comes from my shell zsh.

With your suggestion about locals, it's could be the problem. I have no command locale. After searching, I found locale is a glibc command. My distribution, KISS Linux, is built on musl, not glibc. If I do

export LANG=C

it doesn't help. But probably it only make senses with glibc.

from nextvi.

kyx0r avatar kyx0r commented on July 22, 2024

I am starting to think that this might be a bug in hund since it read the character '?' correctly, but still it does not make any sense what could be off. Let's continue debugging then. Sorry I forgot that KISS linux does not have locale, I don't use KISS linux at the moment but I did in the past, partly why is because I spent eternity configuring my kernel to get the touchscreen to work and still it did not, what a mess. Did you get all your hardware to work on it? I don't think where was even any kind of synaptic xorg driver in the kiss repos back then.

Back to the topic, put printf("%d\n", i->kmap[m].c); abort(); https://github.com/kyx0r/neatvi/blob/master/hund.c#L4525 here. That should print 2. If it does not print anything we found a bug in this code. Also try to put prints in some other areas and give me the outputs if you can so that I have more info to go off with. Or you can try to fix the bug yourself, it may be caused by something silly.

from nextvi.

kyx0r avatar kyx0r commented on July 22, 2024

Actually, forget about everything I just said, I think I know why it's not working. The help page apparently uses a pager like less or whatever is $PAGER in your environment. But since it's KISS it does not have a pager installed i think? It obviously does not work. See here https://github.com/kyx0r/neatvi/blob/master/hund.c#L1762

from nextvi.

Vouivre avatar Vouivre commented on July 22, 2024

Concerning KISS linux: I have also a touchpad. It works without a problem. Keep in mind I only need to use it as a mouse and to use the buttons. I disabled tapping. I think it's possible to use other features in the touchpad, like: putting the finger on the right and going from top to down to emulate the scrolling. I don't need something like that if it's possible. So I can't give you a feedback. If you have any question, I can search exactly what I installed and I can help you if possible. I had not a lot of problem with the kernel. Feel free to ask , you have my email address!

I added printf("%d\n", i->kmap[m].c); abort(); and effectively it prints 2.

I have less installed, but the variable $PAGER was not defined. I added the following to my .zshrc:

export PAGER=less

I closed my terminal and restart a new one. I think it's not necessary to reboot. It doesn't work.

I can see in the code that less is used and sh. less and sh in KISS linux are the ones of busybox, not the standard versions. Could it be a problem ?

from nextvi.

Vouivre avatar Vouivre commented on July 22, 2024

Hhhmmm, bad: when I write a character like é in a terminal it displays <dfe9>. It works in Xorg applications like firefox, but not in terminal anymore. I use st. It happends after modyfing the code of hund. If I reboot it doesn't help. Do you have an idea what happened ?

from nextvi.

kyx0r avatar kyx0r commented on July 22, 2024

No idea, anyway I am not sure how experienced you are as a C programmer but, you can find how the help is implemented here https://github.com/kyx0r/neatvi/blob/master/hund.c#L1927

By the way, well you can also try typing :h in hund or ':help' and that should do the same as '?' . If that does not work then we know that the busybox version of less behaves somehow differently from others.

from nextvi.

Vouivre avatar Vouivre commented on July 22, 2024

As you have probably seen, I have some remembers from some years ago in C, but for now it's too difficult for me to understand how the help is implemented. But I can look at the shortcuts in the code.

But in between, bingo! I had a look in the available packages and less is available. After installing it, it works perfectly! But with less of busybox, it doesn't work.

As a side note, it seems to be a bad idea on a musl system to set export LANG=C. It's the reason why I had problems with accented characters after setting it! I have to search why.

I let you close this issue. Perhaps you will only close it, or add a remark in your FAQ. But this issue won't appear very often.

Thank you very much for all your help!

from nextvi.

kyx0r avatar kyx0r commented on July 22, 2024

Makes sense, the C locale does not support UTF, but it should have not been persistent unless you did do add that export command into .zshrc. That is why I was confused as to why reboot did not help you. I see a solution in the future for this kind of issue is to not use a pager in hund at all, and just display help the native way everything else gets displayed. See this is what i mean by when programs call other programs... It's just unreliable blackbox, well now you've seen it for yourself in real life experience. Well I am glad we managed to solve this one.

from nextvi.

kyx0r avatar kyx0r commented on July 22, 2024

Closing issue, pager is no longer a requirement.

from nextvi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.