From a1611ced6de6e58ec77641281a49ed368d7d8cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 19 Feb 2026 10:41:31 +0100 Subject: [PATCH] system: gdbinit: Save command history by default. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By default, GDB does not save history. This improves on the default. * gnu/system/shadow.scm (%default-gdbinit): Add ‘set history’ commands. (gdb-history-placeholder): New variable. (default-skeletons): Add it. Change-Id: Ie3f9c26098066b4bd896b0593546015a1b429209 Signed-off-by: Ludovic Courtès Merges: #6559 --- gnu/system/shadow.scm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index aa7aec782f..f0749972d2 100644 --- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013-2020, 2022-2023, 2025 Ludovic Courtès +;;; Copyright © 2013-2020, 2022-2023, 2025-2026 Ludovic Courtès ;;; Copyright © 2016 Alex Griffin ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2020, 2023 Efraim Flashner @@ -211,7 +211,13 @@ XTerm*metaSendsEscape: true\n")) (define %default-gdbinit (plain-file "gdbinit" - "# Tell GDB where to look for separate debugging files. + "\ +# Record command history. +set history filename ~/.cache/gdb/history +set history save on +set history size 50000 + +# Tell GDB where to look for separate debugging files. guile (use-modules (gdb)) (execute (string-append \"set debug-file-directory \" @@ -291,6 +297,12 @@ for a colorful Guile experience.\\n\\n\"))))\n")) home-config")) +(define gdb-history-placeholder + ;; Since GDB will not create ~/.cache/gdb by itself when attempting to save + ;; its history file, add a placeholder that ensures this directory exists. + (plain-file "gdb-history" + "# GDB command history.\n")) + (define (default-skeletons) "Return the default skeleton files for /etc/skel. These files are copied by 'useradd' in the home directory of newly created user accounts." @@ -308,6 +320,7 @@ home-config")) (".Xdefaults" ,xdefaults) (".guile" ,%default-dotguile) (".config/gdb/gdbinit" ,gdbinit) + (".cache/gdb/history" ,gdb-history-placeholder) ("guix-home-config.scm" ,%default-skeleton-home-config)))) (define (skeleton-directory skeletons)