#scheme

aljazeera@squeet.me

This project helps displaced Syrians who can’t go to school | Al Jazeera Newsfeed

Thousands of children stopped from attending school by the war in Syria are getting an education thanks to a scheme giving online lessons in rebel-held areas...#AlJazeera #AlJazeeraEnglish #Thousands #alJazeera #aljazeeraEnglish #aljazeeralive #aljazeeravideo #aljazeeraEnglish #aljazeeralatest #aljazeeralive #aljazeeralivenews #areas #attending #children #education #latestnews #lessons #newsheadlines #online #rebel-held #right #scheme #school #schooling #stopped #thanks #war
This project helps displaced Syrians who can’t go to school | Al Jazeera Newsfeed

4k1r4@diaspora-fr.org

Hello, I use #Guile #Scheme implementation, and I'd like to know how do you do to get the terminal width (to store in a variable for example)?
After tried with getenv procedure:

(getenv "COLUMNS")

That return #f (unless export COLUMNS=$(tput cols) either in .bashrc or in the guile shebang's script)

#!/usr/bin/env sh
exec env COLUMNS=$(tput cols) guile -s "$0"
!#

But using this, if you resize the terminal, the value is not updated.

So I have to use:
```
(use-modules (ice-9 popen))
(use-modules (ice-9 rdelim))

(define (get-terminal-width)
(let* ([port (open-input-pipe "tput cols")]
[terminal-width (read-line port)])
(close-pipe port)
terminal-width))


May be someone has a more efficient way to get the terminal width, thanks.

#GNUser #Guile #lisp #Scheme #programming