marlonrichert / zsh-autocomplete

🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.
MIT License
5.26k stars 145 forks source link

zsh-autocomplete creates huge logs (upto size 400 GBs) #399

Closed ShrirajHegde closed 2 years ago

ShrirajHegde commented 2 years ago

Environment

print $VENDOR $OSTYPE $SHELL $ZSH_ARGZERO $ZSH_PATCHLEVEL
print -l $_autocomplete__funcfiletrace
git -C ~zsh-autocomplete log --oneline -n1

OUTPUT:

Steps to reproduce

It happens eventually over time. So I am not sure of reproducing. image image

Size increase just in 2-3 minutes. image

Content inside large log file:

.autocomplete.recent_paths.trim:shift:3: shift count must be <= $#
.autocomplete.recent_paths.trim:shift:3: shift count must be <= $#
.autocomplete.recent_paths.trim:shift:3: shift count must be <= $#

This on repeat.

zsh process writing the log file: image

This process does not respond to SIGTERM and requires SIGKILL.

Is there any way to disable logging as a temporary fix?

marlonrichert commented 2 years ago

Please do the following:

ShrirajHegde commented 2 years ago
$'/home/srj/Desktop/misc/installers/distro-grub-themes/customize'
$'/home/srj/Desktop/misc/installers'
$'/media/srj/storage/Others/temp/test'
$'/home/srj

80 (80x24 default size)

Empty with non-zero exit code.

image

marlonrichert commented 2 years ago
  • Run functions -T .autocomplete.recent_paths.trim and share the log contents generated after that.

Empty with non-zero exit code.

Those are not the contents of the log. Again, run functions -T .autocomplete.recent_paths.trim, then share what is printed in the log after doing so.

marlonrichert commented 2 years ago
$'/home/srj/Desktop/misc/installers/distro-grub-themes/customize'
$'/home/srj/Desktop/misc/installers'
$'/media/srj/storage/Others/temp/test'
$'/home/srj

Are you sure that's the entire contents of ~/.local/share/zsh/chpwd-recent-dirs? It should end in a '.

ShrirajHegde commented 2 years ago

Are you sure that's the entire contents of ~/.local/share/zsh/chpwd-recent-dirs? It should end in a '.

It does, I missed it while copying.

marlonrichert commented 2 years ago
  • Run functions -T .autocomplete.recent_paths.trim and share the log contents generated after that.

Empty with non-zero exit code.

Those are not the contents of the log. Again, run functions -T .autocomplete.recent_paths.trim, then share what is printed in the log after doing so.

@ShrirajHegde And what about this? ☝🏽

ShrirajHegde commented 2 years ago

@ShrirajHegde And what about this?

Sorry, somehow missed that.

also, now I am getting zero exit code from the command.

here it is


# 15. .autocomplete.recent_paths.trim [20:30:08.046]
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))

# 15. .autocomplete.recent_paths.trim [20:30:08.547]
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))

# 15. .autocomplete.recent_paths.trim [20:30:08.572]
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))

# 15. .autocomplete.recent_paths.trim [20:30:08.586]
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))

# 15. .autocomplete.recent_paths.trim [20:30:08.619]
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))

# 15. .autocomplete.recent_paths.trim [20:30:08.649]
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))

# 15. .autocomplete.recent_paths.trim [20:30:08.676]
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))

# 15. .autocomplete.recent_paths.trim [20:30:08.706]
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))

# 15. .autocomplete.recent_paths.trim [20:30:08.953]
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
49  local -P total='/  '
50  while ((  3 > COLUMNS  ))
ShrirajHegde commented 2 years ago

@marlonrichert is there a way to disable logging for temporary resolution??

It is filling up my file system

image

marlonrichert commented 2 years ago

Add this to your .zshrc file, after sourcing Zsh Autcomplete:

.autocomplete.recent_paths.trim() {:}
marlonrichert commented 2 years ago

Closing, as I'm unable to reproduce it.