Coder Social home page Coder Social logo

Comments (7)

meowgorithm avatar meowgorithm commented on August 20, 2024

Hi! There are a few questions here so I'm dividing my response into sections accordingly.

Ctrl + Arrows

Good catch! We should absolutely add support ctrl+arrows and word-jumping as soon as charmbracelet/bubbletea#292 is merged. That PR adds support for ctrl+arrow mappings, among another things.

Ctrl versus Alt

You're correct, ctrl is treated differently than alt for technical reasons, and that's actually why we can't provide a mapping for ctrl+backspace and ctrl+delete. ctrl modifiers in the terminal originally existed to send control characters through the wire and manipulate the terminal, which is mostly why they're so limited. For example backspace and ctrl+h both send a backspace to the terminal, and there isn't much way around that.

CSI u (see charmbracelet/bubbletea#293) solves for this, however it's not particularly well supported and, for now, not a viable solution. It's also possible to get an enormous amount of insight into keyboard input on Windows, however we don't plan on implementing that as it's not cross-platform.

Anyway, all this said, we have considered separating out shift, ctrl, and alt modifiers so that they’d be more like alt from an API perspective. Even if we do that however, those modifiers would not be available for every single key (alt included).

from bubbles.

NiloCK avatar NiloCK commented on August 20, 2024

Appreciate the quick info! I am unsurprised that there are deep legacy issues at hand with respect to handling keyboard input in the terminal.

Happy to see progress on the arrows.

from bubbles.

bashbunni avatar bashbunni commented on August 20, 2024

@meowgorithm heyhey looks like the PR you mentioned with the requested changes was merged, can I go ahead and close this issue?

from bubbles.

meowgorithm avatar meowgorithm commented on August 20, 2024

@bashbunni Heya! We added the necessary key binding support in Bubble Tea to make this possible however we still need to add bindings to textinput for ctrl + left/right for word jumping as described above. So what should happen (in this order is):

  1. After the next Bubble Tea release
  2. Bump the Bubble Tea dep in Bubbles
  3. And add the above bindings to textinput

from bubbles.

tartavull avatar tartavull commented on August 20, 2024

Is this still in progress?

I'm trying to either use shift+enter to "submit" the text input value. Or use enter for "submission" and shift+enter for a new line. Is there a way to achieve this with the current implementation? I've tried a few things but nothing worked.

from bubbles.

maaslalani avatar maaslalani commented on August 20, 2024

Is this still in progress?

I'm trying to either use shift+enter to "submit" the text input value. Or use enter for "submission" and shift+enter for a new line. Is there a way to achieve this with the current implementation? I've tried a few things but nothing worked.

Hey @tartavull We are planning to add a way to support shift+enter support to Bubbletea! Currently there isn't a way to recognize this binding since there is limited support in terminals but with the Kitty Keyboard Protocol which is supported in alacritty, kitty, wezterm, etc... we can support it.

from bubbles.

maaslalani avatar maaslalani commented on August 20, 2024

Fixed by #387

from bubbles.

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.