microsoft / azuredatastudio

Azure Data Studio is a data management and development tool with connectivity to popular cloud and on-premises databases. Azure Data Studio supports Windows, macOS, and Linux, with immediate capability to connect to Azure SQL and SQL Server. Browse the extension library for more database support options including MySQL, PostgreSQL, and MongoDB.
https://learn.microsoft.com/sql/azure-data-studio
MIT License
7.54k stars 898 forks source link

Stop associating HTML mime type with Azure Data Studio #3108

Open euandekock opened 5 years ago

euandekock commented 5 years ago

Steps to Reproduce:

1.Install Azure Data Studio 2.Run Azure Data Studio

  1. Close Azure Data Studio 4.Open System File Explorer and double-click on an HTML Page 5.Azure Data Studio will open 6.Look in ~/.config/mimeapps.list

2 new lines have been added:

text/html=azuredatastudio.desktop
x-scheme-handler/azuredatastudio=azuredatastudio.desktop

This is a very annoying behaviour as HTML files are not naturally associated with a database tool, and should remain associated with the default web browser.

ttilberg commented 5 years ago

Steps to Reproduce:

1.Install Azure Data Studio 2.Run Azure Data Studio

This is a very annoying behaviour as HTML files are not naturally associated with a database tool, and should remain associated with the default web browser.

More specifically, this doesn't just happen once after install, and you change it back and all is good -- it constantly overrides the setting every time you open ADS.

Each time I open Azure Data Studio I have to go back and change my default .html association back to Sublime. This is very frustrating because I use tools that open .html temp files directly, and this workflow now no longer works because I always have to go back to digging for the file in /tmp manually.

ttilberg commented 5 years ago

Can anyone give insight on what files might need to be changed or what's at play? I don't know the components of the system that trigger this change, but it seems very easy to reproduce, and it's frustrating that this keeps getting punted to later releases.

My suspicion is that the fix lies somewhere in the files in or around one of these:

https://github.com/Microsoft/azuredatastudio/blob/master/resources/linux/debian/postinst.template

https://github.com/Microsoft/azuredatastudio/blob/f54d8ce36fc1e12e97306dd4fdbd5221cd2def56/src/sql/parts/notebook/models/contracts.ts#L18

https://github.com/Microsoft/azuredatastudio/blob/81329fa7faaf76be0d9646e09e9935c2c075fc21/src/vs/editor/common/services/languagesRegistry.ts#L110

https://github.com/Microsoft/azuredatastudio/blob/81329fa7faaf76be0d9646e09e9935c2c075fc21/src/vs/base/common/mime.ts#L39

ttilberg commented 5 years ago

I have a file ~/.config/mimeapps.list which is where my application Open With preferences get defined from nautilus > right click > Properties > Open With menu.

If I set HTML document to Sublime Text, I see an entry:

text/html=sublime-text_subl.desktop

The next time I open Azure Data Studio, it is reliably overwritten to:

text/html=azuredatastudio.desktop

Ubuntu 18.04.1 LTS Azure Data Studio 1.3.8 2019-01-08

kburtram commented 5 years ago

@ttilberg this sounds like behavior we "inherited" from the VS Code fork or other upstream dependency (i.e. our team didn't write code to do this). I'll take a look and try to see what's going on here.

ttilberg commented 5 years ago

@kburtram In case this is helpful, I also have vscode installed, and do not experience the same issue there. I know that doesn't guarantee anything, but it might give you less work in identifying the cause.

Forage commented 5 years ago

Good to see I'm not the only one experiencing this issue. In my case it's .jsp pages being opened by ADS while it should be in the browser to display the help from Eclipse based applications.