Comments (29)
You can find the log file in the same folder of the config file. The log file is picgo.log
from picgo-core.
I can't reproduce in my Mac.
I have to look at your log file for more details
from picgo-core.
The picgo.log file remains unchanged, but I managed to capture the crash event at Event Viewer when executing "picgo upload".
提供程序“Registry”为 Started。
详细信息:
ProviderName=Registry
NewProviderState=Started
SequenceNumber=1
HostName=ConsoleHost
HostVersion=5.1.18362.628
HostId=7b77d0c9-eca8-4e0e-86dc-1419805a2b21
HostApplication=powershell -noprofile -noninteractive -nologo -sta -executionpolicy unrestricted -windowstyle hidden -file C:\Users\79917\node_modules\picgo\dist\src\utils\clipboard\windows10.ps1 C:\Users\79917\.picgo\20200309145807.png
EngineVersion=
RunspaceId=
PipelineId=
CommandName=
CommandType=
ScriptName=
CommandPath=
CommandLine=
from picgo-core.
提供程序“Alias”为 Started。
详细信息:
ProviderName=Alias
NewProviderState=Started
SequenceNumber=3
HostName=ConsoleHost
HostVersion=5.1.18362.628
HostId=7b77d0c9-eca8-4e0e-86dc-1419805a2b21
HostApplication=powershell -noprofile -noninteractive -nologo -sta -executionpolicy unrestricted -windowstyle hidden -file C:\Users\79917\node_modules\picgo\dist\src\utils\clipboard\windows10.ps1 C:\Users\79917\.picgo\20200309145807.png
EngineVersion=
RunspaceId=
PipelineId=
CommandName=
CommandType=
ScriptName=
CommandPath=
CommandLine=
from picgo-core.
提供程序“Environment”为 Started。
详细信息:
ProviderName=Environment
NewProviderState=Started
SequenceNumber=5
HostName=ConsoleHost
HostVersion=5.1.18362.628
HostId=7b77d0c9-eca8-4e0e-86dc-1419805a2b21
HostApplication=powershell -noprofile -noninteractive -nologo -sta -executionpolicy unrestricted -windowstyle hidden -file C:\Users\79917\node_modules\picgo\dist\src\utils\clipboard\windows10.ps1 C:\Users\79917\.picgo\20200309145807.png
EngineVersion=
RunspaceId=
PipelineId=
CommandName=
CommandType=
ScriptName=
CommandPath=
CommandLine=
from picgo-core.
from picgo-core.
from picgo-core.
from picgo-core.
from picgo-core.
from picgo-core.
from picgo-core.
Hope this help.
from picgo-core.
Not help. Maybe you can clone the repo, install and run npm run dev
into the dev mode, then add some console.log into the Lifecycle.ts
to see what happened.
Then use node ./bin/picgo upload
to upload and see the log
from picgo-core.
Add these log commands.
// lifecycle main
console.log("To run 'beforeTransform'");
await this.beforeTransform(this.ctx);
console.log("'beforeTransform' ends");
console.log("To run 'doTransform'");
await this.doTransform(this.ctx);
console.log("'doTransform' ends");
console.log("To run 'beforeUpload'");
await this.beforeUpload(this.ctx);
console.log("'beforeUpload' ends");
console.log("To run 'doUpload'");
await this.doUpload(this.ctx);
console.log("'doUpload' ends");
console.log("To run 'afterUpload'");
await this.afterUpload(this.ctx);
console.log("'afterUpload' ends");
return this.ctx;
Any problem with your windows.ps1 or windows10.ps1 file?
from picgo-core.
Never change the files above in the recent releases. That's wired. Maybe you can check the .picgo
folder to see if the windows.ps1
and windows10.ps1
exists and files not broken
from picgo-core.
Yet it works with the selected image.
Is there any clipboard logic change because of win 10 update?
from picgo-core.
Nope. Clipboard image uploading depends on windows10.ps1 and getClipboardImage and not change in recent releases.
from picgo-core.
you can run the script with your powershell:
notice the -xx
below should use the option in getClipboardImage.ts
powershell -noprofile -xxx -xx -xx -file windows10.ps1 imagepath
And see what happened. I think it maybe the powershell's problem.
from picgo-core.
Ran this command and a binary file was generated. Is the parameter "imagepath" right?
from picgo-core.
hmmmmmmmmm, imagePath
is a png image filename. Such as xxx.png
https://github.com/PicGo/PicGo-Core/blob/dev/src/utils/getClipboardImage.ts#L25
powershell -noprofile -xxx -xx -xx -file windows10.ps1 test.png
And you should capture a picture before running this script.
If a png file is generated, then the script is no problem and not a problem with picgo. So maybe it's the system permission issues
from picgo-core.
After a long time of consecutive debug grinding, I finally caught the root of this crash bug, which is the wrong use of PowerShell command.
According to page159 of Ed Wilson's Windows PowerShell 3.0 First Steps, a Microsoft Press book, it states that in order to keep the PowerShell console open you have to add parameter "-noexit" before running the PowerShell scripts. Screenshots are as follows.
In the case of picgo-core, the getClipboardImage.ts needs to read output from the PowerShell script execution, yet it is impossible to read output if the intrinsic PowerShell console close automatically after running windows10.ps1, so you need to add "-noexit". And in my debug grinding, you also need to comment "-windowstyle" and "hidden", although I still don't know the reason, it works eventually.
Here it is.
from picgo-core.
Will this change cause the powershell window
to open explicitly?
It is expected that image uploading will be performed without disturbing the user. Is this consistent with the previous experience after adding this parameter?
And this script has always been normal before, that's wired.
from picgo-core.
Run in CMD and no PowerShell console will explicitly pops up.
In my guess, your acquiring the clipboard implementation from vs-picgo, which mainly takes advantage of the integrated CMD terminal of vscode, leads to the ignorance of use of picgo-core clipboard outside of vscode's integrated cmd terminal. Therefore, when Typora officially acquires picgo-core and provides documentation, this potential problem becomes apparent, because Typora users using picgo-core need to add custom command, and the custom command calls the native cmd, not integrated one, thus it does not behave like vscode's.
In vscode's integrated cmd terminal, it makes no difference to add '-noexit' or not, maybe for some customized mechanism.
from picgo-core.
Run in CMD and no PowerShell console will explicitly pops up.
In my guess, your acquiring the clipboard implementation from vs-picgo, which mainly takes advantage of the integrated CMD terminal of vscode, leads to the ignorance of use of picgo-core clipboard outside of vscode's integrated cmd terminal. Therefore, when Typora officially acquires picgo-core and provides documentation, this potential problem becomes apparent, because Typora users using picgo-core need to add custom command, and the custom command calls the native cmd, not integrated one, thus it does not behave like vscode's.
In vscode's integrated cmd terminal, it makes no difference to add '-noexit' or not, maybe for some customized mechanism.
Nice, if the user experience is the same as before, then I should merge your PR. Did you test in Typora?
from picgo-core.
CMD test result:
from picgo-core.
But it will block the console and will not exit?
from picgo-core.
Thanks for point out my ignorance of the cursor. Refer to this Stack Overflow problem and finally find a solution from Joe Johnston's comment.
How to exit PowerShell.exe inside of CMD
The right way to fix the bug is as follows.
#windows10.ps1
function main{
.....
$imagePath
# fix windows 10 native cmd crash bug when "picgo upload"
# https://github.com/PicGo/PicGo-Core/issues/32
Exit 1
}
execution = spawn('powershell', [
'-noprofile',
'-noninteractive',
'-nologo',
'-sta',
'-executionpolicy', 'unrestricted',
// fix windows 10 native cmd crash bug when "picgo upload"
// https://github.com/PicGo/PicGo-Core/issues/32
// '-windowstyle', 'hidden',
// '-noexit',
'-file', scriptPath,
imagePath
])
from picgo-core.
CMD test result:
Before fix:
Then crashes.
After Fix:
from picgo-core.
Thanks for your contribution!
from picgo-core.
Related Issues (20)
- [PicGo ERROR]: RequestError: Error: read ECONNRESET HOT 3
- Import Error: `ReferenceError: Can't find variable: process` HOT 1
- upload e.startsWith is not a function HOT 1
- 请教,插件升级中遇到问题 HOT 3
- 增加自定义目录 HOT 1
- 请教一下,写了一个 Uploader,使用时报出错误 HOT 3
- Fix smms domain HOT 1
- 请问picgo upload命令行能否实现多文件上传 ? HOT 1
- uploading failed HOT 1
- picgo通过web-uploader插件上传到群晖nas搭建的chevereto,输出成功,但没有真正上传 HOT 4
- picgo-core 不识别网络图片链接 HOT 12
- smms图床上传图片失败 RequestError: Error: connect ETIMEDOUT HOT 5
- setting.logLevel不生效 HOT 3
- asdf HOT 1
- 希望允许Uploader返回的URL不被urlencode HOT 1
- 【小白请教个问题】在vue项目中使用项目,webpack compiled 报错问题 HOT 1
- [插件开发问题] 实现一个Google Drive 上传并拷贝共享链接功能的问题
- picgo剪切板上传问题 HOT 2
- macos idea中复制到粘贴板的图片 上传后无法打开 HOT 1
- 返回的链接有问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from picgo-core.