-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How change shortcut for Popup Windows #596
Comments
No, the keys inside popup windows aren't configurable. |
@chrisant996 Is there any chance that this will be possible in the future, or is it hardcoded and probably won't be configurable?? |
There are no plans to enable configuration of keys in popup lists. However, I am considering whether to add a setting like Some examples:
|
I think there should be such information now, even if this action is not configurable. The problem is that I often select entries from the list, which then only need to be slightly modified before execution. Pressing This isn't the first time I've encountered this problem, so I finally decided to bring it up. It would be best if both of these actions had a configurable shortcut. But if this is not possible, a simple reverse (as you propose) would be enough and solve this problem.
It is enough to clearly describe the use of this option in the manual along with any potential problems in certain environments (if they actually arise). I think that if someone discovers this new option, they will first try to find its official description. Btw., I noticed that in |
I've had requests to show literally all available keys. But the available keys don't all fit in the footer. The reason Del is listed in the history list is because that's the only key whose functionality is conditional/different between the different popup list windows, and because it's completely undiscoverable otherwise. I get that Enter is interesting as the main action, and it's nice to know what the main action will be. But what happens with Enter is different in each popup list (history, directory, key bindings, custom lists in Lua scripts, etc). Should the meaning of Enter be reversed in all popup lists? Should the meaning be listed in the footer in every popup list? What about custom popup lists shown by Lua scripts, where Clink has no idea what will happen? There is a slippery slope here, and it quickly falls into complexity that is very difficult to manage.
Can I ask what software has conditioned you to expect that Enter in a history list won't execute the history entry? Maybe if I know more about the background of this problem, it might help find a solution that doesn't devolve into great complexity.
But,
Have you considered using fzf with clink-fzf and configuring its key bindings to meet your needs?
Perhaps for you it is enough. I have to think broadly, since everyone would have access to it. As for "if they actually arise" -- what about when you install Clink on another computer? Or start a new profile? It'll behave the default way again. So if you reversed the behavior, then they'll behave opposite from what you expect.
Correct. Because Left/Right in Clink's popup lists scroll the list contents left/right if any lines don't fit (i.e. got truncated). That's documented behavior. |
Right, it gets more complicated if there are different variants of lists. Maybe in the first attempt it is worth doing it in a simpler way (like additional information in the footer).
In the case of
I'll try it out when I have some free time, but
But this applies to every option changed to a state other than the default one? If we change options, we know exactly what we are doing and what can happen if we do not have access to the previous configuration files. Maybe it's enough to simply add in the footer that |
Can I ask what software has conditioned you to expect that Enter in a history list won't execute the history entry? Maybe if I know more about the background of this problem, it might help find a solution that doesn't devolve into great complexity. (The only example I know of is fzf, which it sounds like you haven't used before.)
My point was that none of the other options control whether something is dangerous. You're right that accidentally executing a history entry can be dangerous. ("clink.ctrld_exits" is the closest to being something that could be considered dangerous.) What about when you use an instance of Clink where you haven't changed the configuration yet? E.g. on a new machine or in a new profile?
I'm only considering adding But even doing only that already starts down a slippery slope because then people will complain that |
P.S. clink.popuplist lets the caller specify a specific width. Even just You're raising good points. But there's more to it, and this topic is more complicated than it may appear at first glance. |
Commit 729fa89 adds |
v1.6.12 is available with the change. |
@chrisant996 Hello, I see you asked several times:
I just want to add my 5 cents onto this topic. Personally I use My opinion is that execution from history is dangerous and it's not always obvious what Enter will do. Despite the fact that I use this configuration like many years, I still forget from time to time what Enter will do (probably, because I use not only my Windows machine). This is actually true even for Life would be much easier if every history tool would just always insert the history command on Enter and never execute it. Even CTRL + Enter for execution is unnecessary, as if I really want to execute the command, I will just press Enter again. But this time I will do this from command line, where it is obvious that Enter will execute the command, as this behavior is universal between command line interpreters / OSes, therefore no misremembering is possible. Also, more often than not I need to change the command from history before execution. Even if I don't need to change anything, it is often beneficial to insert the command first to check the full command line (history usually shows trimmed line as it is too long). So, in my opinion, Enter to insert should be the default and probably the only option in any tool. Of course, I'm not advocating to change it just because I personally think it will be good. I'm not even a target audience as I don't use clink's history window anyway (I prefer fzf for fuzzy search). I just want to answer your question and make you to better understand why someone could want this. Cheers and thank you for the continuing the development of this great tool! 👍 Without it, my windows experience with command line would be very bad and I probably would run everything in WSL just like many people that are bringing that trend now. |
@xak2000 Thank you for sharing your context. I happen to agree with a lot of what you shared. I'm also interested to know @ArkadiuszMichalski 's context, because that might lead to identifying more options. My personal view point is similar: in the absence of any other context or pre-existing implementations, I would probably choose for Enter to insert without executing. But:
I receive complaints when Clink is different from bash defaults. I get it; different people use different software and workflows, and it's natural to want similarity and familiarity. I can't control the fact that a bunch of programs already exist and already behave differently from each other. There's no way to please all competing perspectives, so I try to find reasonable compromises.
I don't see a good path forward that accommodates all viewpoints and concerns. Fzf is a good alternative approach, which allows insert (but doesn't even allow execute). The OP said they don't want to add another dependency, and that's a very reasonable position. |
It sounds like you're describing my experience. After a few unwanted calls commands from history, I started to be afraid of this @chrisant996
At the moment I don't have time to explore the new tool, but I will try it someday (because maybe in my case it will be more convenient, who knows).
It's nice because we immediately know that If anyone has more interesting observations or simpler solutions, feel free to share them. |
I understand that part. I'm interested to know what happened sometime in the past, before ever using Clink, that set the expectation that Enter would not execute. I.e. why was it surprising that Enter executes in the history list? It executes in the command line. It executes in a menu. It executes in dialog box. Etc. Is there some other specific software experience you're used to where Enter on a selected command does not execute the command? I want to learn about that other experience. I consider it a valid experience, whatever it was -- I'm not going to try to explain it away, instead I want to understand it.
I understand where you're coming from, and I'm examining many more details and considerations. I'm sorry the concerns aren't making sense. I have half a mind to just add an option, without addressing any of the problems it creates, and let the problems become obvious through empirical experience. But I don't think that would be fair to anyone, and that would make it even harder to address the problems later.
The fact that this exact thing works differently in most other programs means that behaving differently is likely to be unexpected, and needs to be considered carefully. Especially because there is potential for danger. I'm sorry the dangers aren't making sense. I hear you. But this is not nearly so simple or straightforward as you're suggesting.
For any suggestion about the history popup list, I have to ask "how would this work in all other popup lists in Clink, including custom ones added in custom Lua scripts that I don't even know about?" I recognize that only the history popup list seems to be of interest in this conversation. But these suggestions affect way more than just the history popup list. Or if they don't, then they create a fragmented experience that causes other problems. I can't agree quickly to these suggestions, because there's much deeper investigation necessary to avoid creating more problems than it solves. You don't have to engage in the deeper investigation, but arguing against deeper investigation would undermine credibility. |
I'm a 20+ years long time MC (Midnight Commander) user. It is my main instrument for any Unix system. Previously in the times of DOS and Windows 95 I used Volcov Commander and Norton Commander. So, again, my experience is probably not a main-stream for today's trends. But you asked for a software - this is it. :) In MC ALT-H brings the history of commands and SHIFT-ALT-H brings the history of directories.
As you can see the behavior is inconsistent in these 2 lists. This is true, but to me this behavior is totally sane and expected. And what is even more important: even if someone forgot that Enter will not execute the command, this behavior will be obvious after pressing Enter - the command will be insterted in the command line - and the one can just hit Enter again. It is safe-by-default behavior. The other behavior is dangerous by default. From the tools you described I have used only Far, but very long time ago, so I do not remember how it worked. Never used
I'm not sure I understand your concerns about the configuration option. It is a configuration option after all. It's not changing of defaults (that I would prefer, but it's just me 😄). So, if you change some options on PC1 and then do a fresh install on PC2 without your config, then all the options will be default. It is totally expected behavior. I can't imagine someone complaining about it. :) How else configuration options could work? The only scenario I can think about, is that you just want to protect people from themselves. If someone changes the default settings on PC1 and then will accidentally execute a dangerous command on PC2 because they forgot that on PC2 the settings are not configured the same way as on PC1... then yes, probably, this could be problematic. But with the same logic every existing software should remove the hotkeys configuration, then. :) Most people will not change them anyway. They are supposed for people who want to change them for one reason or another. Nevertheless, personally I don't think that the option like I don't know what Bindings popup list is, so can't say anything about it. Anyway, I fully understand that you must consider much more than I or some other peope as you must think about all the functionality as a whole. To my shame, I don’t know even half of the clink’s functionality. @ArkadiuszMichalski I strongly suggest to try |
@xak2000 Perfect, thanks, that's exactly the kind of context I wanted to learn. I assumed that since Far is kind of the spiritual successor to Norton Commander, and Far executes on Enter in the history list, then probably NC also did. My assumption was wrong, and that's very useful to know. I used NC for a while back in the day, but ultimately settled on using 4Dos/4NT. And in those JPSoft products execute on Enter in the history list. So my perception had been that execute was predominant. Why am I asking these questions, and what am I considering? I'm actually considering removing the ability to execute on Enter ... And maybe even completely removing the ability for any key combo to execute in the history list. The sole reason I made it execute was for compatibility with CMD and JPSoft and Far. Because some friends who are long time CMD or JPSoft or Far users have expressed strong expectations for 100% behavioral compatibility (which is obviously not fully possible anyway). But I don't like the risks it poses. So I want to take a deep hard look at feasibility of completely removing the ability to directly execute. Although, an accidental double tap of Enter would still execute after inserting. And blocking that kind of accident gets prohibitively problematic. I'm not a fan at all of allowing it to be configurable -- that opens the door to even more problems. So, I either want to completely remove execute on Enter, or I want to find an in between compromise, like |
@chrisant996 Just to clear, it is not NC (Norton Commander) that I described at the beginning of the previous comment. It's MC (Midnight Commander) - a spiritual successor of NC, but for Unix. I hardly remember anything about NC as I used it last time 20 years ago when DOS (and Windows 3.11, 95, 98) was predomintant. With Windows 2000 and later there was no more DOS under the hood - all later Windows systems were NT-based. And NC/VC were superseded by TC (Total Commander) and Far on Windows. And with MC on Unix. |
Yes, agreed - in my mind if any of the NC-like breed insert instead of execute, then that strongly undermines the "but compatibility!!!" arguments that pushed for execute. |
By the way, a clarification: Choosing a history item in the popup list and pressing Shift-Enter doesn't "insert" the selected history item. Instead, it jumps to the selected history item in the command history. As if you pressed Up/Down repeatedly in the input line until you reached the selected history item (i.e. pressed a key bound to So, I wouldn't want to make the footer claim that it "inserts", since that's not actually what it does. |
Hi, is there any way to change some shortcut for Popup Windows History? I want to change:
so that they behave the opposite, i.e. let Enter does not execute the command, only insert it.
I can't find the commands responsible for these actions.
The text was updated successfully, but these errors were encountered: