News for hackers. Stuff that matters.
Re:Contour: Modern and Fast Terminal Emulator by kelsey9876543 on Sunday October 08, 2023 @09:02AM (#37810080)
i don't see the point of adding vi input mode to the emulator when we have it inside bash with `set -o vi`
Re:Contour: Modern and Fast Terminal Emulator by Gualdrapo on Sunday October 08, 2023 @09:07AM (#37810118)
As it supports Windows, I guess it would be useful for them
Re:Contour: Modern and Fast Terminal Emulator by kelsey9876543 on Sunday October 08, 2023 @09:24AM (#37810239)
bash runs on windows
[dead]
Re:Contour: Modern and Fast Terminal Emulator by miloignis on Sunday October 08, 2023 @03:02PM (#37813412)
Are you referring to WSL/2? The msys2 / Git Bash integration is more integrated with Windows then how I interpret your description.
Re:Contour: Modern and Fast Terminal Emulator by drbaba on Sunday October 08, 2023 @10:31AM (#37810784)
Many interpreters don’t use Readline (e.g. IPython and Zsh), and enabling inconsistent Vi keybinsings in each one can be a bit annoying. From that perspective, adding it to the terminal seems a possibly easier way to get it “everywhere”?
Re:Contour: Modern and Fast Terminal Emulator by mhitza on Sunday October 08, 2023 @10:42AM (#37810894)
Possibly more universal, but there are also tools like rlwrap [1] that adds readline support to programs that don't have it. From the docs apparently the readline library ships a similar tool ootb nowadays but I haven't tried that and just noticed now when I wanted to share the rlwrap link.

[1] https://github.com/hanslub42/rlwrap

Re:Contour: Modern and Fast Terminal Emulator by williadc on Sunday October 08, 2023 @11:53AM (#37811571)
IPython absolutely uses readline
Re:Contour: Modern and Fast Terminal Emulator by drbaba on Sunday October 08, 2023 @03:52PM (#37813840)
Not anymore. Since IPython v5 (5+ years ago?), readline was replaced with prompt_toolkit.

EDIT: Here’s an official source: https://ipython.readthedocs.io/en/stable/whatsnew/version5.h...

Re:Contour: Modern and Fast Terminal Emulator by trapnii on Monday October 09, 2023 @10:41AM (#37820929)
To be fair, the vi input mode (or modal input modes) in Contour are way more than simply doing `set -o vi` in bash. You cannot compare those two.

The reason why I implemented modal input modes (vi mode) in Contour is, that I noticed Tilix [1] is having vi input modes and people seemed to like it, I wonder if it might be useful to me personally as well, especially since I'm a heavy VIM user, I asked myself if it might make sense to have in a terminal. So let's get it in.

I was surprised how much it became part of my daily live, in fact, there's no need to grab the mouse at all when using Contour. You press Ctrl+Shift+Space (configurable) to enter normal mode and move the cursor just like in vim (way beyond the basic support that Alacritty implemented).

Especially paired with the indicator statusline support, when showing this one permanently (you can also change the color of that statusline), it became one of the first-class features for me on why I like Contour (not just because I am developing it).

Fun things to do (especially when shell integration is enabled):

- `yim`: to yank the text in between two markers (that is your command output) - `%`: jump to matching bracket, good when having cat'ed a long json file and you want to quickly browse around - you can also rectangular select like in vim, and then press either p (includes LF) or <S-p> which joins the multiline clipboard text into a single line (removing LF's), that payed off a lot for output like `git status` and wanting to operate on parts of the output (files e.g.)

Have a look at the still young website's documentation here: https://contour-terminal.org/input-modes/#supported-text-obj...

for a more complete look of what you can do with the keyboard (normal mode) :)

[1] https://github.com/thestinger/termite/