Re: reduce number of lines available for completion

Tomasz Pala <[email protected]>
Newsgroups gmane.comp.shells.zsh.user
Message-ID <[email protected]>
Both problems maybe fixed:

function short-menu-complete {
  {
	local _saved_LINES="$LINES"
	stty -F $TTY rows $((LINES/2))
		COMPLETION_ACTIVE=1
	zle menu-expand-or-complete
  } always {	# this is crucial - execute _after_ TRAPINT
		COMPLETION_ACTIVE=0
	stty -F $TTY rows "$_saved_LINES"
	LINES="$_saved_LINES"
  }
}

function TRAPINT {
	if [[ $COMPLETION_ACTIVE = 1 ]]; then
		COMPLETION_ACTIVE=0
	fi
	return 1
}

- the latter being redundant if not used for other things.
I don't like messing with stty, but DECSTBM seems to clear entire screen
when set.


BTW is there a better way to recognize running completion inside TRAPINT?

-- 
Tomasz Pala <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.