diff --git a/pkg/wshrpc/wshremote/wshremote_file.go b/pkg/wshrpc/wshremote/wshremote_file.go index 3589cc998c..f336b9d8bb 100644 --- a/pkg/wshrpc/wshremote/wshremote_file.go +++ b/pkg/wshrpc/wshremote/wshremote_file.go @@ -565,6 +565,14 @@ func (impl *ServerImpl) RemoteFileStreamCommand(ctx context.Context, data wshrpc finfo, err := os.Stat(cleanedPath) if err != nil { + if os.IsNotExist(err) { + writer.Close() + return &wshrpc.FileInfo{ + Path: wavebase.ReplaceHomeDir(data.Path), + Dir: computeDirPart(data.Path), + NotFound: true, + }, nil + } writer.CloseWithError(err) return nil, fmt.Errorf("cannot stat file %q: %w", data.Path, err) }