remote-vscode icon indicating copy to clipboard operation
remote-vscode copied to clipboard

open several files at once

Open bschnabel opened this issue 7 years ago • 18 comments

Hallo,

with remote atom it's posible to write into my remote bash something like rmate file1.txt file2.txt or even rmate file* and it opens multiple files at once.

I thought this doesn't work in VSCode because of the preview mode in vscode so I deactivated it through "workbench.editor.enablePreview": false in my user settings.

However it doesnt work. It still opens just one file in VSCode.

I would love to see above feature in remote vscode. Do you think this is something doable?

Thanks a lot!

bschnabel avatar Oct 25 '17 11:10 bschnabel

Hi,

Yes, it is doable, I though is was already working, but it is not.

I will need to investigate that and implement the solution.

rafaelmaiolla avatar Oct 25 '17 11:10 rafaelmaiolla

I see the same problem, happened just recently for me, no more than a week ago. Used to work great, and was able to open several files at once.

romanmar avatar Nov 01 '17 21:11 romanmar

I didn't change anything in the extension in the last few weeks. Seems to be something else.

Regarding the investigation, I didn't have time to take a look on it yet.

rafaelmaiolla avatar Nov 02 '17 10:11 rafaelmaiolla

Yep, I had an older version of Visual Studio Code 1.11.2, and am able to open multiple files, so works well. I'm guessing its broken for versions 1.51 and newer. Since rmate feature is more important to me, I'll just use that for now. Thanks.

romanmar avatar Nov 07 '17 20:11 romanmar

A fix to opening multiple files (however not at once) is the "Keep Open" option which you can activate by right clicking the tab you want to "keep open" (or Ctrl + K Enter) and then run rmate on the following files you want open.

Edit: Any form of stabilizing the file in VSCode will "Keep Open" for example saving. If you're able to call on save for every file you open with rmate then its possible to open multiple files at once.

ketozhang avatar Nov 13 '17 17:11 ketozhang

Is opening a folder support in plan ?

ampresent avatar Dec 15 '17 09:12 ampresent

Any update on this? I really love this concept, but not being able to have more than 1 file open at a time really kills it's big benefit for me.

iamwyza avatar Feb 05 '18 20:02 iamwyza

I found sshfs is very handy. It's better than remote-vscode, and it's more general in use.

ampresent avatar Feb 06 '18 04:02 ampresent

My Solution/Workaround for this:

use the Command Palette Ctrl-Shift-P to open your settings file, just enter "Preferences: Open User Settings"!

Once you've opened your settings file (your settings file should be located on the right), add the "workbench.editor.enablePreview": false

romanmar avatar Mar 21 '18 04:03 romanmar

Dear @romanmar . In the very first post when I described the problem I already included that solution. but I'm still unable to to rmate file1.txt file2.txt or even rmate file* which both was possible with remote-atom and rmate

bschnabel avatar Mar 21 '18 09:03 bschnabel

You are welcome to contribute and help investigating the issue.

rafaelmaiolla avatar Mar 21 '18 11:03 rafaelmaiolla

@bschnabel Oh I see, for me I had problems when I opened one file at time. Why won't you write a workaround, wrap rmate script and just call rmate for each file, it would work well. Here is what I have in my .bashrc Just dont open it in a directory that has 100's of files, or write a script to limit it to 10.

rmate() {
        for var in "$@"
        do
                ~/bin/rmate --host $SSH_RHOST -p 52698 -m "${HOSTNAME}@${var}" $var
        done
}

romanmar avatar Mar 21 '18 15:03 romanmar

that's a good idea. would this also work with something like rmate *.conf? By now I just sort of got used to open the files one bye one.

bschnabel avatar Mar 21 '18 15:03 bschnabel

So I have similar style of a work around. I set "workbench.editor.enablePreview" to false and then I use small python script to open up the files I want.

import os

openList = ['meta.py', 'aemain.py', 'alphaEngine.py', 'enigma.py', 'epoch.py', 'phaseToDensity.py', 'plotFactory.py', 'printShop.py', 'os_sys_tools.py' ]

for py in openList:

  cmd = 'rmate -p 19998 ' + py
  os.system(cmd)

kjswanson avatar Jul 15 '18 23:07 kjswanson

@rafaelmaiolla , any update on @ComfyDusts' PR to solve this? I'm an Atom user who's recently considering switching to VSCode, but only being able to edit one file at a time is a severe limitation. Setting workbench.editor.enablePreview to False had no effect on my Mac. Currently my workaround is to just keep using Atom.

drscotthawley avatar Dec 05 '18 04:12 drscotthawley

I will take a look in the next couple days.

rafaelmaiolla avatar Dec 06 '18 16:12 rafaelmaiolla

The code as is is not going to work. It need to refactored.

rafaelmaiolla avatar Dec 06 '18 18:12 rafaelmaiolla

ls -p | grep -v / | while read x; do rmate $x; done

Logerfo avatar Jul 17 '19 18:07 Logerfo