Reload .Xresources without restarting the xterm
Asked Answered
S

4

51

To use ALT key in vim without tweaking, the escaping should be disabled in xterm. Without escaping the ALT will not work in bash for shortcuts.

to work around I need to reload this option before starting vim:

XTerm*metaSendsEscape: false | xrdb -load 

Any idea how I can reload .Xresource and make changes take effect without restarting the terminal window ?
Open to other terminal to have ALT work both in vim and bash.

Sudd answered 13/2, 2014 at 6:18 Comment(2)
try xrdb ~/.XresourceKofu
This is the same as cat .Xresource | xrdb -load. it requires a terminal restart.Sudd
O
16

xterm will not reread resources just because you run xrdb. X applications only read resources when they are initializing.

Besides the menu entry (added in patch #122, 1999), one could use two other ways to change the metaSendsEscape resource:

  • escape sequence, documented in XTerm Control Sequences

    CSI ? Pm h DEC Private Mode Set (DECSET). ... Ps = 1 0 3 6 -> Send ESC when Meta modifies a key. (This enables the metaSendsEscape resource).

  • editres (but very cumbersome due to the large number of resources)

Overtrump answered 7/8, 2016 at 0:57 Comment(0)
B
99

This will reload the .Xresources:

xrdb ~/.Xresources

Source: Arch wiki

Bahr answered 23/11, 2014 at 5:55 Comment(7)
This answer should be deleted, since it is irrelevant to the question.Overtrump
@ThomasDickey This question is 1st result for googling "reload Xresources".Seminar
@Seminar It's also 1st result for googling "reload xresources without restarting xterm". What's your point?Scarbrough
This answer has been suggested and rejected in the commments to the question. It does not work without restarting any program.Impressure
This plus making a new terminal window worked for me.Plagiarize
+1 to delete this answer. In the question I pipe to xrdb -load which is equivalent this this. I obviously tried this.Sudd
i will immolate and delete itTirrell
O
16

xterm will not reread resources just because you run xrdb. X applications only read resources when they are initializing.

Besides the menu entry (added in patch #122, 1999), one could use two other ways to change the metaSendsEscape resource:

  • escape sequence, documented in XTerm Control Sequences

    CSI ? Pm h DEC Private Mode Set (DECSET). ... Ps = 1 0 3 6 -> Send ESC when Meta modifies a key. (This enables the metaSendsEscape resource).

  • editres (but very cumbersome due to the large number of resources)

Overtrump answered 7/8, 2016 at 0:57 Comment(0)
I
4

YAY, just checked, and XTerm has the option in its menu! I thought I saw it in there...

XTerm responds to each of left-, middle- (aka scrollwheel) and right-click with individual option menus when you're holding down the Ctrl key.

In your case, "Meta Sends Escape" is in the ctrl+left-click menu :)

Also, examining all three menus (if just to be aware of the options' existence) is a very good idea. I frequently use the font selector, for example.

Indoaryan answered 20/3, 2014 at 19:11 Comment(0)
R
2

Had to put xterm*metaSendsEscape: true into .Xdefaults, using .Xresources did not want to work for me under 16.04.

Followed up by a xrdb ~/.Xdefaults.

Renfrow answered 17/4, 2018 at 10:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.