paul-schaaf / vshell

v(oice) shell
MIT License
5 stars 0 forks source link

Crash with 'ls -a' #43

Open patrickreece2 opened 9 months ago

patrickreece2 commented 9 months ago

thread 'main' panicked at /Users/p.reece/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.25.0/src/buffer.rs:229:26: index out of bounds: the len is 3075 but the index is 3138 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

reproducible by starting 'vshell' then using 'ls -a' in my documents folder

paul-schaaf commented 9 months ago

i just pushed a fix for another panic. can you pull and try again?

it doesnt look like the same panic though. Can you show me output of ls -a in a different shell or create an example with a dummy folder that also leads to the program crashing?

patrickreece2 commented 9 months ago

Here is a shell script that creates 100 empty files, which crash vshell (on my mac) when 'ls' is called


#!/bin/bash

# Specify the directory where you want to create the files
directory="."

# Create 100 empty files
for ((i=1; i<=100; i++)); do
    if ((i % 2 == 0)); then
        # Add a dot at the beginning for even-numbered files
        touch "$directory/.$i.txt"
    else
        touch "$directory/$i.txt"
    fi
done

echo "Files created successfully."```
paul-schaaf commented 9 months ago

thanks! btw you can use triple dash to show the script correctly in markdown. Ive edited your comment to do that.

i think I found a way to reproduce it

paul-schaaf commented 9 months ago
patrickreece2 commented 9 months ago

yes, on

paul-schaaf commented 9 months ago

when you open the shell and the hints are already on, you are in fact not using the latest version of the shell. The latest version has them turned off by default