[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/08: installer: Fix the startup locale.
From: |
John Darrington |
Subject: |
01/08: installer: Fix the startup locale. |
Date: |
Fri, 10 Feb 2017 08:17:11 -0500 (EST) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit 7cb7d31277ca4ceec12bc9eccb08378ef2b69cdd
Author: John Darrington <address@hidden>
Date: Sun Feb 5 16:50:47 2017 +0100
installer: Fix the startup locale.
* gnu/system/installer/guixsd-installer.scm (guixsd-installer): Don't
try to restore the locale after initialisation.
---
gnu/system/installer/guixsd-installer.scm | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/gnu/system/installer/guixsd-installer.scm
b/gnu/system/installer/guixsd-installer.scm
index 4f2e92b..0d48f1e 100644
--- a/gnu/system/installer/guixsd-installer.scm
+++ b/gnu/system/installer/guixsd-installer.scm
@@ -44,7 +44,7 @@
(ice-9 format)
(ice-9 match)
- (ice-9 pretty-print)
+ (ice-9 i18n)
(srfi srfi-1)
(srfi srfi-9))
@@ -287,17 +287,13 @@ tail of the list."
(lambda ()
(define stdscr
- ((lambda ()
- ;; initscr must be called whilst the UTF-8 encoding is in the
locale.
- ;; Otherwise, on certain terminal types, bad things will happen when
- ;; one later changes to UTF-8.
- (define old-locale #f)
- (dynamic-wind
- (lambda ()
- (set! old-locale (setlocale LC_ALL))
- (setlocale LC_ALL "en_US.UTF-8"))
- (lambda () (initscr)) ;; Initialise ncurses
- (lambda () (setlocale LC_ALL old-locale))))))
+ ;; initscr must be called whilst the UTF-8 encoding is in the locale.
+ ;; Otherwise, on certain terminal types, bad things will happen when
+ ;; one later changes to UTF-8.
+ (let ((enc (locale-encoding)))
+ (when (not (equal? enc "UTF-8"))
+ (setlocale LC_ALL "en_US.utf8"))
+ (initscr)))
;; We don't want any nasty kernel messages damaging our beautifully
;; crafted display.
@@ -317,7 +313,6 @@ tail of the list."
(let ((page (make-page
stdscr (gettext "GuixSD Installer")
main-page-refresh 0 main-page-key-handler)))
-
(page-enter page)
(let loop ((ch (getch stdscr)))
(let ((current-page (car page-stack)))
- branch wip-installer updated (688f4f7 -> e0eeeab), John Darrington, 2017/02/10
- 08/08: gurses: Don't crash if asked for an item by an invalid index., John Darrington, 2017/02/10
- 06/08: installer: Remove whitespace., John Darrington, 2017/02/10
- 05/08: gurses: Update the cursor position when posting the form., John Darrington, 2017/02/10
- 03/08: installer: Remove unused procedure., John Darrington, 2017/02/10
- 01/08: installer: Fix the startup locale.,
John Darrington <=
- 07/08: installer: Provide the ability to add new users., John Darrington, 2017/02/10
- 04/08: installer: New page to edit user accounts., John Darrington, 2017/02/10
- 02/08: installer: Add users page., John Darrington, 2017/02/10