unison
unison copied to clipboard
home and end keys should work in ucm
we had a user asking how to get their
By following this page I was able to get these working by putting the following in my ~/.haskeline:
keyseq: "\ESC[H" home
keyseq: "\ESC[F" end
This accomplishes the desired behaviour, but we should set this up for users by default.
@ChrisPenner says:
If anyone wants an easy contribution I think you just need to convert this to runInputTWithPrefs and pass the appropriate Prefs value:
Line.runInputT
settings
(haskelineCtrlCHandling go)
convert this to runInputTWithPrefs and pass the appropriate Prefs value
What would the appropriate Prefs value be? It wouldn't override the settings that I have in my ~/.haskeline file, would it? Don't you take my historyDuplicates: IgnoreAll or editMode: Vi from me! 😛. But seriously though.
If anyone wants an easy contribution I think you just need to convert this to
runInputTWithPrefsand pass the appropriatePrefsvalue:
You can't build this Prefs value programmatically though because Haskeline's Prefs is not an exported module and not only Prefs is not reexported, which results in the only way to build a Prefs value you need is to readPrefs :: FilePath -> IO Prefs (sic!).
What would the appropriate
Prefsvalue be?
It's the one returned from readPrefs <path_of_the_file_with_these_lines>
It wouldn't override the settings that I have in my ~/.haskeline file, would it?
It seems it would, because https://github.com/judah/haskeline/blob/30aafaf7171ba1f42236eea1d69a3c60af99284d/System/Console/Haskeline/InputT.hs#L175 doesn't fall back to readPrefsFromHome, unless we have appended our custom prefs to the existing user's ~/.haskeline content.
To sum this up: in order to get custom prefs taking into account user's custom prefs we need to create a (temporary?) plaintext prefs file, copy ~/.haskeline content there, add Home & End bindings and supply a path to this file to readPrefs.
IMO this issue should be resolved by reporting appropriate issues against haskeline. Thoughts?
To sum this up: in order to get custom prefs taking into account user's custom prefs we need to create a (temporary?) plaintext prefs file, copy ~/.haskeline content there, add Home & End bindings and supply a path to this file to readPrefs.
Hrmm, yeah that's definitely regrettable.
IMO this issue should be resolved by reporting appropriate issues against haskeline. Thoughts?
Agreed, it does seem like we should be able to set reasonable defaults for our own application.
Agreed, it does seem like we should be able to set reasonable defaults for our own application.
It's true in general, but IMO this particular issue is out of scope of UCM: the Home & End moving caret to the begin and end of the current line respectively is a default behavior of readline (just checked it by running rltest.c of readlines examples), and therefore haskeline should act same way.
in fact this issue is a exact duplicate of https://github.com/judah/haskeline/issues/30 which is closed at the moment but it apparently shouldn't