diff --git a/libexec/kak b/libexec/kak new file mode 120000 index 00000000..a903b0d0 --- /dev/null +++ b/libexec/kak @@ -0,0 +1 @@ +../src/kak \ No newline at end of file diff --git a/src/Makefile b/src/Makefile index e292af60..97d7bc5b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -55,6 +55,7 @@ PREFIX ?= /usr/local DESTDIR ?= # root dir bindir := $(DESTDIR)$(PREFIX)/bin +libexecdir := $(DESTDIR)$(PREFIX)/libexec/kak sharedir := $(DESTDIR)$(PREFIX)/share/kak docdir := $(DESTDIR)$(PREFIX)/share/doc/kak mandir := $(DESTDIR)$(PREFIX)/share/man/man1 @@ -162,6 +163,7 @@ distclean: clean installdirs: install -d $(bindir) \ + $(libexecdir) \ $(sharedir)/rc \ $(sharedir)/colors \ $(sharedir)/doc \ @@ -170,6 +172,7 @@ installdirs: install: kak man installdirs install -m 0755 kak $(bindir) + ln -rsf $(bindir)/kak $(libexecdir)/kak install -m 0644 ../share/kak/kakrc $(sharedir) install -m 0644 ../doc/pages/*.asciidoc $(sharedir)/doc cp -r ../rc/* $(sharedir)/rc diff --git a/src/shell_manager.cc b/src/shell_manager.cc index 8d70dd1c..591a708d 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -72,7 +72,7 @@ ShellManager::ShellManager(ConstArrayView builtin_env_vars) // have access to the kak command regardless of if the user installed it { const char* path = getenv("PATH"); - auto new_path = format("{}:{}", path, split_path(get_kak_binary_path()).first); + auto new_path = format("{}../libexec/kak:{}", split_path(get_kak_binary_path()).first, path); setenv("PATH", new_path.c_str(), 1); } }