zsh-workers
 help / color / mirror / code / Atom feed
* Live Clock Causes Directory Flashing In URxvt & XTerm
@ 2014-06-09 12:50 S M
  2014-06-09 13:19 ` Frank Terbeck
  2014-06-09 16:02 ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: S M @ 2014-06-09 12:50 UTC (permalink / raw)
  To: zsh-workers


[-- Attachment #1.1: Type: text/plain, Size: 1424 bytes --]

Hello zsh Team,

These are my specs;

Slackware 14.1 x86_64
xorg-server-1.14.3
Nvidia GTX660M - nvidia drivers 331.67
zsh-5.0.2
rxvt-unicode-9.20
xterm-297

I'm using this option to have a live clock in my ~/.zshrc

TMOUT=1
TRAPALRM() {
     zle reset-prompt
}

In URxvt it constantly flashes, in xterm it flashes on and off more
randomly, and I also noticed in xterm the entire directory appears to get
brighter as well as flashing.

So as example, 'cd /etc/' then tap tab to see the directory, try this in a
directory with a small amount of directories, or open the term full screen
to see a huge directory, but play with it, and at that point the terminal
starts flashing.

I have not been able to find a fix for this, the only temporary solution is
to increase the time, as an example below;

TMOUT=10

Then it's not so noticeable, around every 10 seconds you see a flash, but
this is also not good because when the time changes, the terminal will not
change till 10 seconds later, there's a lag doing this.

I hope the zsh team can fix this problem, and if you need my help please
contact me.

I'm attaching a copy of my ~/.zshrc and I created a short video called,
zsh_flicker.m4v that you can download from my dropbox;

https://www.dropbox.com/s/o0gmkpbxp8f42u3/zsh_flicker.m4v

If you look carefully you will see the directory flashing every second.

Thank you much for your time and help in this matter.

Mii Bolen

[-- Attachment #1.2: Type: text/html, Size: 1841 bytes --]

[-- Attachment #2: .zshrc --]
[-- Type: application/octet-stream, Size: 5397 bytes --]

##############################
## zsh config file ~/.zshrc ##
##                          ##
##############################
## variables -----------------------------------------------------------
export BROWSER="firefox"
export EDITOR="nano"
export PAGER="most"
export NMON=cmdn
# text normal colors
alias 256colors='for code in {0..255}; do echo -e "\e[38;05;${code}m $code: Test"; done'
case $TERM in (xterm|screen) TERM=$TERM-256color;; esac
# reset color
NC='\e[0m'
########################################################################
## options #############################################################
########################################################################
# misc -----------------------------------------------------------------
# use vi keybinds
bindkey -v
# no beep
unsetopt beep
unsetopt hist_beep
unsetopt list_beep
# display errors
#setopt print_exit_value
# confirm 'rm *'
unsetopt rm_star_silent
# no error on search 
setopt nullglob
# completion menu
setopt auto_menu
# confirm 'rm *' etc
setopt rm_star_wait
# don't &proc kill on exit
setopt auto_continue
# don’t nice &proc
setopt no_bg_nice
# keys -----------------------------------------------------------------
typeset -A key
key[Home]=${terminfo[khome]}
key[End]=${terminfo[kend]}
key[Insert]=${terminfo[kich1]}
key[Delete]=${terminfo[kdch1]}
key[Up]=${terminfo[kcuu1]}
key[Down]=${terminfo[kcud1]}
key[Left]=${terminfo[kcub1]}
key[Right]=${terminfo[kcuf1]}
key[PageUp]=${terminfo[kpp]}
key[PageDown]=${terminfo[knp]}
# setup key accordingly
[[ -n "${key[Home]}"    ]]  && bindkey  "${key[Home]}"    beginning-of-line
[[ -n "${key[End]}"     ]]  && bindkey  "${key[End]}"     end-of-line
[[ -n "${key[Insert]}"  ]]  && bindkey  "${key[Insert]}"  overwrite-mode
[[ -n "${key[Delete]}"  ]]  && bindkey  "${key[Delete]}"  delete-char
[[ -n "${key[Up]}"      ]]  && bindkey  "${key[Up]}"      up-line-or-history
[[ -n "${key[Down]}"    ]]  && bindkey  "${key[Down]}"    down-line-or-history
[[ -n "${key[Left]}"    ]]  && bindkey  "${key[Left]}"    backward-char
[[ -n "${key[Right]}"   ]]  && bindkey  "${key[Right]}"   forward-char
# history --------------------------------------------------------------
# history size
HISTSIZE=5000
SAVEHIST=5000
# history file
HISTFILE=~/.zsh_history
# history without double entry
setopt hist_ignore_all_dups
# all zsh instance share same file
setopt share_history
# update history
setopt inc_append_history
########################################################################
## alias ###############################################################
########################################################################
# ls & grep ------------------------------------------------------------
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
########################################################################
## file type alias #####################################################
########################################################################
alias -s html=$BROWSER
alias -s pdf=epdfview
alias -s svg=inkscape
alias -s png=viewnior
alias -s jpg=viewnior
alias -s gif=viewnior
alias -s txt=$EDITOR
alias -s conf=$EDITOR
alias -s py=$EDITOR
alias -s php=$EDITOR
alias -s mp3=deadbeef
alias -s ogg=deadbeef
alias -s ogv=smplayer
alias -s flv=smplayer
alias -s avi=smplayer
alias -s mp4=smplayer
alias -s mkv=smplayer
alias -s m3u=deadbeef
alias -s zip=dtrx
alias -s tar=dtrx
alias -s tar.gz=dtrx
alias -s tar.bz2=dtrx
alias -s xz=dtrx
alias -s rar=dtrx

########################################################################
## completion ##########################################################
########################################################################
autoload -Uz compinit
compinit
zstyle ':completion:*' auto-description 'specify: %d'
zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' menu select=1
eval "$(dircolors -b)"
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-compctl false
zstyle ':completion:*' verbose true
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'

########################################################################
## prompt ##############################################################
########################################################################
autoload -Uz promptinit
autoload -U colors && colors
promptinit
setopt PROMPT_SUBST
PROMPT="%F{202} %D{%I}%f%F{251}:%f%F{202}%D{%M}%f%F{214} %D{%P}%f %F{199}%n%f >"
RPROMPT="%F{251}<%f %F{blue}%M%f:%F{cyan}%y%f:%F{yellow}%~%f"
TMOUT=1
TRAPALRM() {
     zle reset-prompt
}
## EOF #################################################################

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Live Clock Causes Directory Flashing In URxvt & XTerm
  2014-06-09 12:50 Live Clock Causes Directory Flashing In URxvt & XTerm S M
@ 2014-06-09 13:19 ` Frank Terbeck
  2014-06-09 16:02 ` Bart Schaefer
  1 sibling, 0 replies; 5+ messages in thread
From: Frank Terbeck @ 2014-06-09 13:19 UTC (permalink / raw)
  To: S M; +Cc: zsh-workers

Hi,

I can't say much about the problem you're describing, but I've spotting
something in your setup, that I thought I might mention:

S. M. wrote:
[...]

You do this for keyboard setup:

> typeset -A key
> key[Home]=${terminfo[khome]}
[...]

> [[ -n "${key[Home]}"    ]]  && bindkey  "${key[Home]}"    beginning-of-line
[...]

That will only work reliably, if you also put the terminal you're using
into keyboard-transmit mode while the line editor (ZLE) is active. You
can do that like this:

#+BEGIN_SRC shell
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then

    # If these entries are not  available for a given terminal, then
    # that terminal  is in  keyboard-transmit mode by  default. That
    # means, everything  is well  without any additional  action. If
    # not, this can do the trick:

    function zle-line-init () {
        echoti smkx
    }

    function zle-line-finish () {
        echoti rmkx
    }

    zle -N zle-line-init
    zle -N zle-line-finish

fi
#+END_SRC


Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Live Clock Causes Directory Flashing In URxvt & XTerm
  2014-06-09 12:50 Live Clock Causes Directory Flashing In URxvt & XTerm S M
  2014-06-09 13:19 ` Frank Terbeck
@ 2014-06-09 16:02 ` Bart Schaefer
  2014-06-10  2:05   ` S M
  1 sibling, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2014-06-09 16:02 UTC (permalink / raw)
  To: S M, zsh-workers

On Jun 9,  2:50am, S M wrote:
}
} So as example, 'cd /etc/' then tap tab to see the directory, try this in a
} directory with a small amount of directories, or open the term full screen
} to see a huge directory, but play with it, and at that point the terminal
} starts flashing.

This is happening because the completion list gets erased and redrawn each
time there is a 'zle reset-prompt' call.  This in turn happens because
zle doesn't know whether the prompt changed size (new number of lines,
etc.) since the last time it was repainted, and the completion listing
code is a pluggable module that doesn't know what else zle may have done,
so the only way they can collectively be sure to keep a clean display is
to do a full refresh.

Consider putting the live clock in your terminal title bar instead of in
the prompt, or update it less than once per second as you've already
tried.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Live Clock Causes Directory Flashing In URxvt & XTerm
  2014-06-09 16:02 ` Bart Schaefer
@ 2014-06-10  2:05   ` S M
  2014-06-12 23:46     ` S M
  0 siblings, 1 reply; 5+ messages in thread
From: S M @ 2014-06-10  2:05 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 2516 bytes --]

Hi Frank & Bart,

Thank you Bart, I've been able to get it better by making the time
increase, but I'll try out the titlebar too.

Frank I'm new to zsh and this is config from the distro livarp that is dead
now that I copied from.

At this point in time I'm still clueless with a lot of it.

If it's not to much trouble can you please show me how you'd correct this
keys section for any problems?
I got a little of what you said before Frank, but don't quite fully
understand?


# keys -----------------------------------------------------------------
typeset -A key
key[Home]=${terminfo[khome]}
key[End]=${terminfo[kend]}
key[Insert]=${terminfo[kich1]}
key[Delete]=${terminfo[kdch1]}
key[Up]=${terminfo[kcuu1]}
key[Down]=${terminfo[kcud1]}
key[Left]=${terminfo[kcub1]}
key[Right]=${terminfo[kcuf1]}
key[PageUp]=${terminfo[kpp]}
key[PageDown]=${terminfo[knp]}
# setup key accordingly
[[ -n "${key[Home]}"    ]]  && bindkey  "${key[Home]}"    beginning-of-line
[[ -n "${key[End]}"     ]]  && bindkey  "${key[End]}"     end-of-line
[[ -n "${key[Insert]}"  ]]  && bindkey  "${key[Insert]}"  overwrite-mode
[[ -n "${key[Delete]}"  ]]  && bindkey  "${key[Delete]}"  delete-char
[[ -n "${key[Up]}"      ]]  && bindkey  "${key[Up]}"      up-line-or-history
[[ -n "${key[Down]}"    ]]  && bindkey  "${key[Down]}"
down-line-or-history
[[ -n "${key[Left]}"    ]]  && bindkey  "${key[Left]}"    backward-char
[[ -n "${key[Right]}"   ]]  && bindkey  "${key[Right]}"   forward-char


Thank you both again...

Cheers


On Mon, Jun 9, 2014 at 6:02 AM, Bart Schaefer <schaefer@brasslantern.com>
wrote:

> On Jun 9,  2:50am, S M wrote:
> }
> } So as example, 'cd /etc/' then tap tab to see the directory, try this in
> a
> } directory with a small amount of directories, or open the term full
> screen
> } to see a huge directory, but play with it, and at that point the terminal
> } starts flashing.
>
> This is happening because the completion list gets erased and redrawn each
> time there is a 'zle reset-prompt' call.  This in turn happens because
> zle doesn't know whether the prompt changed size (new number of lines,
> etc.) since the last time it was repainted, and the completion listing
> code is a pluggable module that doesn't know what else zle may have done,
> so the only way they can collectively be sure to keep a clean display is
> to do a full refresh.
>
> Consider putting the live clock in your terminal title bar instead of in
> the prompt, or update it less than once per second as you've already
> tried.
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Live Clock Causes Directory Flashing In URxvt & XTerm
  2014-06-10  2:05   ` S M
@ 2014-06-12 23:46     ` S M
  0 siblings, 0 replies; 5+ messages in thread
From: S M @ 2014-06-12 23:46 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 4331 bytes --]

I'm still a noob with all this and someone said to make my .zshrc section
like this now, I'm assuming is correct?

THANKS again! :)

# keys -----------------------------------------------------------------
#+BEGIN_SRC shell
if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then

    # If these entries are not  available for a given terminal, then
    # that terminal  is in  keyboard-transmit mode by  default. That
    # means, everything  is well  without any additional  action. If
    # not, this can do the trick:

    function zle-line-init () {
        echoti smkx
    }

    function zle-line-finish () {
        echoti rmkx
    }

    zle -N zle-line-init
    zle -N zle-line-finish

fi
#+END_SRC
typeset -A key
key[Home]=${terminfo[khome]}
key[End]=${terminfo[kend]}
key[Insert]=${terminfo[kich1]}
key[Delete]=${terminfo[kdch1]}
key[Up]=${terminfo[kcuu1]}
key[Down]=${terminfo[kcud1]}
key[Left]=${terminfo[kcub1]}
key[Right]=${terminfo[kcuf1]}
key[PageUp]=${terminfo[kpp]}
key[PageDown]=${terminfo[knp]}
# setup key accordingly
[[ -n "${key[Home]}"    ]]  && bindkey  "${key[Home]}"    beginning-of-line
[[ -n "${key[End]}"     ]]  && bindkey  "${key[End]}"     end-of-line
[[ -n "${key[Insert]}"  ]]  && bindkey  "${key[Insert]}"  overwrite-mode
[[ -n "${key[Delete]}"  ]]  && bindkey  "${key[Delete]}"  delete-char
[[ -n "${key[Up]}"      ]]  && bindkey  "${key[Up]}"      up-line-or-history
[[ -n "${key[Down]}"    ]]  && bindkey  "${key[Down]}"
down-line-or-history
[[ -n "${key[Left]}"    ]]  && bindkey  "${key[Left]}"    backward-char
[[ -n "${key[Right]}"   ]]  && bindkey  "${key[Right]}"   forward-char


On Mon, Jun 9, 2014 at 4:05 PM, S M <themolesbox@gmail.com> wrote:

> Hi Frank & Bart,
>
> Thank you Bart, I've been able to get it better by making the time
> increase, but I'll try out the titlebar too.
>
> Frank I'm new to zsh and this is config from the distro livarp that is
> dead now that I copied from.
>
> At this point in time I'm still clueless with a lot of it.
>
> If it's not to much trouble can you please show me how you'd correct this
> keys section for any problems?
> I got a little of what you said before Frank, but don't quite fully
> understand?
>
>
> # keys -----------------------------------------------------------------
>
> typeset -A key
> key[Home]=${terminfo[khome]}
> key[End]=${terminfo[kend]}
> key[Insert]=${terminfo[kich1]}
> key[Delete]=${terminfo[kdch1]}
> key[Up]=${terminfo[kcuu1]}
> key[Down]=${terminfo[kcud1]}
> key[Left]=${terminfo[kcub1]}
> key[Right]=${terminfo[kcuf1]}
> key[PageUp]=${terminfo[kpp]}
> key[PageDown]=${terminfo[knp]}
> # setup key accordingly
>
> [[ -n "${key[Home]}"    ]]  && bindkey  "${key[Home]}"    beginning-of-line
> [[ -n "${key[End]}"     ]]  && bindkey  "${key[End]}"     end-of-line
> [[ -n "${key[Insert]}"  ]]  && bindkey  "${key[Insert]}"  overwrite-mode
> [[ -n "${key[Delete]}"  ]]  && bindkey  "${key[Delete]}"  delete-char
> [[ -n "${key[Up]}"      ]]  && bindkey  "${key[Up]}"
> up-line-or-history
> [[ -n "${key[Down]}"    ]]  && bindkey  "${key[Down]}"
> down-line-or-history
> [[ -n "${key[Left]}"    ]]  && bindkey  "${key[Left]}"    backward-char
> [[ -n "${key[Right]}"   ]]  && bindkey  "${key[Right]}"   forward-char
>
>
> Thank you both again...
>
> Cheers
>
>
> On Mon, Jun 9, 2014 at 6:02 AM, Bart Schaefer <schaefer@brasslantern.com>
> wrote:
>
>> On Jun 9,  2:50am, S M wrote:
>> }
>> } So as example, 'cd /etc/' then tap tab to see the directory, try this
>> in a
>> } directory with a small amount of directories, or open the term full
>> screen
>> } to see a huge directory, but play with it, and at that point the
>> terminal
>> } starts flashing.
>>
>> This is happening because the completion list gets erased and redrawn each
>> time there is a 'zle reset-prompt' call.  This in turn happens because
>> zle doesn't know whether the prompt changed size (new number of lines,
>> etc.) since the last time it was repainted, and the completion listing
>> code is a pluggable module that doesn't know what else zle may have done,
>> so the only way they can collectively be sure to keep a clean display is
>> to do a full refresh.
>>
>> Consider putting the live clock in your terminal title bar instead of in
>> the prompt, or update it less than once per second as you've already
>> tried.
>>
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-06-12 23:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-09 12:50 Live Clock Causes Directory Flashing In URxvt & XTerm S M
2014-06-09 13:19 ` Frank Terbeck
2014-06-09 16:02 ` Bart Schaefer
2014-06-10  2:05   ` S M
2014-06-12 23:46     ` S M

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).