To permanently remove the Ctrl-X 1 binding in Bash, follow these steps:
Step 1: Identify the Current Binding
First, confirm the binding is active in your shell:
bash
bind -q "\C-x1"
You should see output like:
code
"\C-x1": vi-eWord
Step 2: Unbind the Key in ~/.inputrc (Recommended)
The ~/.inputrc file is the standard place to configure Readline (the library handling keyboard input in Bash).
Open ~/.inputrc in a text editor:
bash
nano ~/.inputrc
or
bash
kate ~/.inputrc
Add this line to unbind Ctrl-X 1:
bash
"\C-x1": ""
Save the file and reload the configuration:
bash
bind -f ~/.inputrc
Step 3: Alternative: Unbind in ~/.bashrc
If you prefer to modify ~/.bashrc instead (e.g., if ~/.inputrc isn't sourced by default):
Open ~/.bashrc:
bash
nano ~/.bashrc
Add this line at the end:
bash
bind '"\C-x1":""'
Save the file and reload your shell configuration:
bash
source ~/.bashrc
Step 4: Verify the Binding is Removed
Check again to confirm the binding is gone:
bash
bind -q "\C-x1"
If successful, the output will show no binding:
code
"\C-x1": not found
Step 5: Test in Emacs
Open Emacs in Konsole and verify Ctrl-X 1 now works as expected.
Notes
Terminal Restart Required: If changes don't take effect immediately, close and reopen your terminal.
Vi Mode Users: If you use set -o vi in Bash (vi-style editing), ensure the binding isn't part of a vi-specific configuration. The steps above still apply.
Global vs. Local: These changes apply to your user account. If you use multiple profiles or terminals, repeat the steps for each relevant configuration.
Troubleshooting
If the issue persists:
Check for conflicting configurations in other files (e.g., ~/.bash_profile, ~/.profile).
Use bind -l to list all Readline functions and ensure no other bindings interfere.
This should resolve the Ctrl-X 1 conflict in Konsole! 🚀