Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One drive - requires downloading all files to function #73

Open
Xeue opened this issue Mar 22, 2022 · 7 comments
Open

One drive - requires downloading all files to function #73

Xeue opened this issue Mar 22, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@Xeue
Copy link

Xeue commented Mar 22, 2022

If you are using onedrive (I assume other cloud providers too?) this has to download the file in order to work out it's icon. This takes a longtime and downloads a lot of files you may not want locally.

Expected Behavior

???

Current Behavior

When listing files in a onedrive folder, it has to download the files first to work out the icon

Possible Solution

Possibly have an option to only load icons if there is a local copy.
If file is not local try and use the file extension?

Steps to Reproduce (for bugs)

  1. Navigate to a onedrive folder with files that you have not downloaded
  2. Type dir
  3. Sadness

Context

Accidentally downloaded 100GB of video files by accident...

Your Environment

Win 11
Windows terminal
Used alongside oh so posh
Whatever the latest version was at the time of writing (soz)

@devblackops devblackops added the bug Something isn't working label Mar 22, 2022
@devblackops
Copy link
Owner

devblackops commented Mar 22, 2022

Thanks for the issue @Xeue. That's definitely not a good experience. I don't think Terminal-Icons does anything explicit to pull down the file (we don't do reads on the file itself). We only access properties from the System.IO.FileSystemInfo object passed from Get-ChildItem. I'll do some research on why this is happening and if we can mitigate it.

@Xeue
Copy link
Author

Xeue commented Mar 22, 2022

I did realise as writing it that you don't use the file content, strange how that works... I've been having these kind of issues in a couple of programs recently and with some googling I'm not the only one. It could be a windows 11 thing maybe? I am on the insider dev builds at the moment (22579) I'll test on my win 10 PC when I get home. Aside from that, great work, lovely little tool

@drwtsn32x
Copy link

I can't reproduce this problem on my system.

@mattcargile
Copy link

I can't repro it either. Usually there will be a pop-up in Windows tell you that a certain program is downloading a file. Ripgrep for instance this happens on for me.

@Xeue
Copy link
Author

Xeue commented Mar 27, 2022

I have tested further, it doesn't occur on my main machine. Only my secondary, and since the time of reporting I have moved to the next insider builder and it's gone away. So false alarm! Windows insider things... Apologies all.

@Xeue Xeue closed this as completed Mar 27, 2022
@Xeue Xeue reopened this Mar 27, 2022
@Xeue
Copy link
Author

Xeue commented Mar 27, 2022

I take it back, now it's happening on my main machine. I am indeed getting the windows "Automatic file downloads" popup when I do this.

@mattcargile
Copy link

mattcargile commented Mar 28, 2022

I wonder if there is something else going on with your type data in your $PROFILE or something else? Additionally, seeing as you are on an Insider build, I wonder if there is something new within [FileInfo] or [DirectoryInfo] that is causing the download to occur. What version of .NET are you running?

Post your type data in a session where this behavior is presenting. The below code works on PowerShell 7.2.2 and may not work on 5.1 to grab the type data.

Get-FormatData System.IO.DirectoryInfo, System.IO.FileInfo | Export-FormatData -path filedirinfo.ps1xml -IncludeScriptBlock

Here is some code to run in your impacted PowerShell session to grab the .NET version.

[System.Runtime.InteropServices.RuntimeInformation]::get_FrameworkDescription()

I'd also try to rule out the $PROFILE by running a pwsh -noprofile -noexit -Command ipmo terminal-icons to see if the behavior happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants