Comments (14)
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.
I am using tmux/bash. Does bash support CTRL+Enter I couldn't find anything online?
from ble.sh.
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.
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.
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.
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.
@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.
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.
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.
I run the default terminal application on Ubuntu. So I guess gnome-terminal?
from ble.sh.
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.
Thank you very much! Would you be able to recommend any terminals that would support Ctrl-Enter
?
from ble.sh.
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:
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.
Thank you! I'll look into those!
from ble.sh.
Related Issues (20)
- Multiline completion problem HOT 7
- blesh and nano HOT 5
- AI (GPT/Copilot) integration HOT 1
- ble/prompt: FATAL: detected cyclic dependency (_ble_prompt_ps1 required by _ble_prompt_ps1) HOT 5
- Left/Right arrow keys weird behaviour over SSH on VM HOT 11
- Add a file that I can use to give history of available commands HOT 5
- Mark when you exit ble.sh HOT 2
- Donations HOT 3
- /dev/fd/63: line 1: syntax error near unexpected token `(' HOT 5
- Unbind C-r and bind it to something else HOT 5
- [Bash 5.2] bash: '_alias_completion::gh?' 'gh?': command not found HOT 7
- Receiving strange print-outs in terminal HOT 10
- --help on builtins causes error code 2. HOT 1
- Unable to install ble.sh in Termux HOT 6
- Completion of Kubectl alias k not working HOT 2
- Remaping text-object bind doesn't work HOT 12
- Inconsistence in some TAB Completions HOT 4
- Duplicate prompts when resizing (change in width) HOT 11
- [macOS] In Macos, "option+delete" not able to delete previous word HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ble.sh.