Git Product home page Git Product logo

Comments (14)

akinomyoga avatar akinomyoga commented on June 11, 2024

Is it possible to remap the multiline execution key to another combination (eg. C-Enter)?

Unless you use the vi editing mode, C-Enter is by default the same as C-j and thus can be used to run the command in the multiline mode without any additional configuration. If you are using the vi editing mode, you can change the binding by ble-bind -m vi_imap -f C-RET accept-line.

However, in order to use C-Enter, your terminal needs to support inputting C-Enter. What is your terminal? If your terminal sends the same code for C-Enter as Enter, it is impossible for the line editor to distinguish C-Enter from Enter. Some terminals support configuring the code sent to the application when a specific key combination is pressed. You may need to configure the code for C-Enter (C-RET) as described in a table in ยง3.6.4.

from ble.sh.

Adventune avatar Adventune commented on June 11, 2024

I am using tmux/bash. Does bash support CTRL+Enter I couldn't find anything online?

from ble.sh.

akinomyoga avatar akinomyoga commented on June 11, 2024

I am using tmux/bash.

Thanks, What is the terminal outside tmux? The terminal that sends the key input is the outside terminal, but not tmux. Tmux just passes the key input from the outside terminal to the terminal application (Bash in this case).

Does bash support CTRL+Enter I couldn't find anything online?

The plain Bash with GNU Readline doesn't handle CTRL + Enter by default, so if you use the plain Bash without ble.sh, you need to manually set up a keybinding. However, ble.sh handles CTRL + Enter by default (in the Emacs editing mode, set -o emacs), so you don't need to manually set it up as far as the terminal supports it.

from ble.sh.

Adventune avatar Adventune commented on June 11, 2024

Outside tmux I have bash. Ble.sh is installed as per instructions in the readme. Ctrl+enter does not result in accepting the command

from ble.sh.

akinomyoga avatar akinomyoga commented on June 11, 2024

Outside tmux I have bash.

Bash is not a terminal. What is the outside terminal? There should be a terminal (#1) that starts Bash (#2), and tmux (#3) is started inside #2, and tmux starts another Bash (#4). The resulting connection of streams becomes as follows:

[#1 outside terminal] --+--[#2 outside bash]
                        |
                        +--[#3 tmux]--[#4 bash]

I'm asking about the outside terminal sitting on #1. What is the terminal that starts the outer Bash (#2)?

from ble.sh.

akinomyoga avatar akinomyoga commented on June 11, 2024

Could you give me the result of the following command?

$ ble/widget/display-shell-version

Edit: Could you run the above command in two cases: inside tmux and outside tmux?

from ble.sh.

akinomyoga avatar akinomyoga commented on June 11, 2024

@Adventune Did you solve your problem?

Could you find what is the outer terminal in your setup? Or if you don't know what is your outer terminal, what is your operating system and how do you open the terminal window?

from ble.sh.

Adventune avatar Adventune commented on June 11, 2024

Sorry, forgot to get back to this. Here is the output of the command:

GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu) [Ubuntu 22.04.3 LTS]
ble.sh, version 0.4.0-devel4+3f13393 (noarch) [git 2.34.1, GNU Make 4.3, GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.1)]
bash-completion, version 2.11 (hash:b42f5d6a7ad6d4921ec73838ba54a96d6bd30936, 77071 bytes) (noarch)
locale: LANG=en_US.UTF-8 LC_ADDRESS=fi_FI.UTF-8 LC_IDENTIFICATION=fi_FI.UTF-8 LC_MEASUREMENT=fi_FI.UTF-8 LC_MONETARY=fi_FI.UTF-8 LC_NAME=fi_FI.UTF-8 LC_NUMERIC=fi_FI.UTF-8 LC_PAPER=fi_FI.UTF-8 LC_TELEPHONE=fi_FI.UTF-8 LC_TIME=fi_FI.UTF-8
terminal: TERM=xterm-256color wcwidth=14.0-west/15.1-2+ri, vte:6800 (65;6800;1)

Edit:
and inside tmux:

GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu) [Ubuntu 22.04.3 LTS]
ble.sh, version 0.4.0-devel4+3f13393 (noarch) [git 2.34.1, GNU Make 4.3, GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.1)]
bash-completion, version 2.11 (hash:b42f5d6a7ad6d4921ec73838ba54a96d6bd30936, 77071 bytes) (noarch)
locale: LANG=en_US.UTF-8 LC_ADDRESS=fi_FI.UTF-8 LC_IDENTIFICATION=fi_FI.UTF-8 LC_MEASUREMENT=fi_FI.UTF-8 LC_MONETARY=fi_FI.UTF-8 LC_NAME=fi_FI.UTF-8 LC_NUMERIC=fi_FI.UTF-8 LC_PAPER=fi_FI.UTF-8 LC_TELEPHONE=fi_FI.UTF-8 LC_TIME=fi_FI.UTF-8
terminal: TERM=screen-256color wcwidth=14.0-west/15.1-2+ri, tmux:0 (84;0;0), vte:6800 (65;6800;1)

from ble.sh.

akinomyoga avatar akinomyoga commented on June 11, 2024

Thanks, the above result implies that your outside terminal is one of the VTE-based terminals. However, it is still difficult to identify which specific terminal of the VTE-based one is yours. Can you tell which is your outside terminal? Or can you describe how you start the terminal?

from ble.sh.

Adventune avatar Adventune commented on June 11, 2024

I run the default terminal application on Ubuntu. So I guess gnome-terminal?

from ble.sh.

akinomyoga avatar akinomyoga commented on June 11, 2024

Thank you for your information.

I first checked the settings of the GNOME terminal, but there don't seem to be configuration options for the sequences sent by each keypress.

I also checked the source code of GNOME/vte, which does not seem to support Ctrl-Enter; They ignore all the modifier keys for Enter. The key input is processed in Terminal::widget_key_press (src/vte.cc), which calls another function _vte_keymap_map (src/keymap.cc). How each key is processed is determined based on the entries store in the array _vte_keymap. The entries for Enter is given by _vte_keymap_GDK_Return. However, both _vte_keymap and _vte_keymap_GDK_Return are specified to be in the static scope, so there is no way to modify the key processing from the application side (i.e., the terminal side such as the GNOME terminal).

There seems to be a Feature Request #2658 at the upstream VTE, which suggests a distinct key sequence for Shift-Enter.


To conclude, the terminal that you use does not support Ctrl-Enter (distinctly from Enter) and does not provide a way to customize it. You need to use another terminal that supports Ctrl-Enter or the feature called modifyOtherKeys or a terminal that provides the configuration for custom key sequences.

from ble.sh.

Adventune avatar Adventune commented on June 11, 2024

Thank you very much! Would you be able to recommend any terminals that would support Ctrl-Enter?

from ble.sh.

akinomyoga avatar akinomyoga commented on June 11, 2024

Konsole would be one of the possible options. You may configure Konsole to send a proper sequence with Ctrl-Enter. The configuration is described in #187 (comment). You can specify \E[13;5u for Return+Ctrl-Shift. This is an example:

image

You can find other combinations in Manual ยง3.6.4.

xterm supports the modifyOtherKeys mode, where you don't need additional configurations. The recent terminals with the support for modifyOtherKeys include foot and zutty.

from ble.sh.

Adventune avatar Adventune commented on June 11, 2024

Thank you! I'll look into those!

from ble.sh.

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.