aboutsummaryrefslogtreecommitdiffstats
path: root/noice.c
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2016-02-25 15:06:57 +0000
committersin <sin@2f30.org>2016-02-25 15:14:08 +0000
commit829bcdd7d419b8e07d77edfa9b9878f0f399a99f (patch)
tree7e1333461cdb3c2938c03019b4e94a2ec1e9ec9e /noice.c
parente1c26079b109a8ef074362142636c970ccdc9465 (diff)
downloadnoice-829bcdd7d419b8e07d77edfa9b9878f0f399a99f.tar.gz
Add command to cd back to HOME
Original patch written by Richard Hyde and taken from https://github.com/RichardHyde/noice
Diffstat (limited to 'noice.c')
-rw-r--r--noice.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/noice.c b/noice.c
index b3a2852..489caab 100644
--- a/noice.c
+++ b/noice.c
@@ -57,6 +57,7 @@ enum action {
SEL_HOME,
SEL_END,
SEL_CD,
+ SEL_CDHOME,
SEL_TOGGLEDOT,
SEL_MTIME,
SEL_REDRAW,
@@ -707,6 +708,21 @@ nochange:
strlcpy(fltr, ifilter, sizeof(fltr))
DPRINTF_S(path);
goto begin;
+ case SEL_CDHOME:
+ tmp = getenv("HOME");
+ if (tmp == NULL) {
+ clearprompt();
+ goto nochange;
+ }
+ if (canopendir(tmp) == 0) {
+ printwarn();
+ goto nochange;
+ }
+ strlcpy(path, tmp, sizeof(path));
+ /* Reset filter */
+ strlcpy(fltr, ifilter, sizeof(fltr));
+ DPRINTF_S(path);
+ goto begin;
case SEL_TOGGLEDOT:
if (strcmp(fltr, ifilter) != 0)
strlcpy(fltr, ifilter, sizeof(fltr));
Un proyecto texto-plano.xyz