Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixed screen width issue under solaris -- tput now works

git-svn-id: http://shflags.googlecode.com/svn/trunk/source/1.0@85 9d7cb843-df4f-0410-8a79-4785ae5a3405
  • Loading branch information...
commit 335171e844bad3ec8130ce58275571afae377cbe 1 parent 24c41aa
kate.ward@forestent.com authored

Showing 1 changed file with 4 additions and 5 deletions. Show diff stats Hide diff stats

  1. +4 5 src/shflags
9 src/shflags
@@ -451,12 +451,11 @@ _flags_screenColumns()
451 451 if _flags_size_=`stty size 2>/dev/null`; then
452 452 # stty size worked :-)
453 453 _flags_cols_=`expr "${_flags_size_}" : '[0-9]* \([0-9]*\)'`
454   - elif _flags_cols_=`tput cols 2>/dev/null`; then
455   - # TODO(kward): this doesn't actaully work... tput is executed within a
456   - # sub-shell which causes the screen width to be lost.
457   - : # tput worked :-)
  454 + elif eval tput cols >/dev/null 2>&1; then
  455 + set -- `tput cols`
  456 + _flags_cols_=$1
458 457 else
459   - _flags_cols_=80
  458 + _flags_cols_=80 # default terminal width
460 459 fi
461 460 echo ${_flags_cols_}
462 461 unset _flags_cols_ _flags_size_

0 comments on commit 335171e

Please sign in to comment.
Something went wrong with that request. Please try again.