mirror of
https://github.com/nix-community/home-manager
synced 2024-12-24 18:59:47 +01:00
gnome-terminal: add backspace- and delete-binding options
These settings control the string sent by gnome-terminal when the respective keys are pressed. The options are the ones described in libvte documentation: https://developer.gnome.org/vte/0.48/VteTerminal.html#VteEraseBinding
This commit is contained in:
parent
f0fc2a8702
commit
6fed10a09a
1 changed files with 94 additions and 0 deletions
|
@ -6,6 +6,14 @@ let
|
||||||
|
|
||||||
cfg = config.programs.gnome-terminal;
|
cfg = config.programs.gnome-terminal;
|
||||||
|
|
||||||
|
eraseBinding = types.enum [
|
||||||
|
"auto"
|
||||||
|
"ascii-backspace"
|
||||||
|
"ascii-delete"
|
||||||
|
"delete-sequence"
|
||||||
|
"tty"
|
||||||
|
];
|
||||||
|
|
||||||
backForeSubModule = types.submodule ({ ... }: {
|
backForeSubModule = types.submodule ({ ... }: {
|
||||||
options = {
|
options = {
|
||||||
foreground = mkOption {
|
foreground = mkOption {
|
||||||
|
@ -136,6 +144,90 @@ let
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
description = "Run command as a login shell.";
|
description = "Run command as a login shell.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
backspaceBinding = mkOption {
|
||||||
|
default = "ascii-delete";
|
||||||
|
type = eraseBinding;
|
||||||
|
description = ''
|
||||||
|
Which string the terminal should send to an application when the user
|
||||||
|
presses the <emphasis>Backspace</emphasis> key.
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>auto</literal></term>
|
||||||
|
<listitem><para>
|
||||||
|
Attempt to determine the right value from the terminal's IO settings.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>ascii-backspace</literal></term>
|
||||||
|
<listitem><para>
|
||||||
|
Send an ASCII backspace character (0x08).
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>ascii-delete</literal></term>
|
||||||
|
<listitem><para>
|
||||||
|
Send an ASCII delete character (0x7F).
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>delete-sequence</literal></term>
|
||||||
|
<listitem><para>
|
||||||
|
Send the <quote>@7</quote> control sequence.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>tty</literal></term>
|
||||||
|
<listitem><para>
|
||||||
|
Send terminal’s <quote>erase</quote> setting.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
deleteBinding = mkOption {
|
||||||
|
default = "delete-sequence";
|
||||||
|
type = eraseBinding;
|
||||||
|
description = ''
|
||||||
|
Which string the terminal should send to an application when the user
|
||||||
|
presses the <emphasis>Delete</emphasis> key.
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>auto</literal></term>
|
||||||
|
<listitem><para>
|
||||||
|
Send the <quote>@7</quote> control sequence.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>ascii-backspace</literal></term>
|
||||||
|
<listitem><para>
|
||||||
|
Send an ASCII backspace character (0x08).
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>ascii-delete</literal></term>
|
||||||
|
<listitem><para>
|
||||||
|
Send an ASCII delete character (0x7F).
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>delete-sequence</literal></term>
|
||||||
|
<listitem><para>
|
||||||
|
Send the <quote>@7</quote> control sequence.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><literal>tty</literal></term>
|
||||||
|
<listitem><para>
|
||||||
|
Send terminal’s <quote>erase</quote> setting.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -147,6 +239,8 @@ let
|
||||||
cursor-shape = pcfg.cursorShape;
|
cursor-shape = pcfg.cursorShape;
|
||||||
cursor-blink-mode = pcfg.cursorBlinkMode;
|
cursor-blink-mode = pcfg.cursorBlinkMode;
|
||||||
login-shell = pcfg.loginShell;
|
login-shell = pcfg.loginShell;
|
||||||
|
backspace-binding = pcfg.backspaceBinding;
|
||||||
|
delete-binding = pcfg.deleteBinding;
|
||||||
} // (if (pcfg.customCommand != null) then {
|
} // (if (pcfg.customCommand != null) then {
|
||||||
use-custom-command = true;
|
use-custom-command = true;
|
||||||
custom-command = pcfg.customCommand;
|
custom-command = pcfg.customCommand;
|
||||||
|
|
Loading…
Reference in a new issue