Issue with Github for windows and Custom Shell - windows

I'm having problems trying to set my Custom Shell in Github for windows to Console2.
It seems like no matter what I try it wants to ignore my setting and just launch in powershell.
Under Github for Windows I have the path for my custom shell set to where I have Console2 installed and the checkmark is next to Custom. (double and triple checked this for sanity)
I've tried restarting my computer multiple times, and even changing the setting to the other options (ie cmd and Git Bash).
In all 3 cases launching gitshell still launches Powershell instead.
I tried to search around here and google but haven't found anyone having a similar problem. Is there anywhere (ie registry or db file) where I could check to see how these values are set, and try to override it? Or if anyone else has experiences this problem and has a solution I would greatly appreciate it!

I'm having the same issue as well. As a workaround, choosing "Open in Git Shell" in the gear menu of the GUI client is opening Git Bash (my shell of choice) in the repo I'm in, but this only allows one terminal window and isn't a true solution.
I'm guessing a bug was introduced in one of the recent Windows client updates. I'm going to let them know about it at https://github.com/contact and I suggest others do the same if they also have this issue.

Related

Clear terminal without clearing first line of multi-line prompt

I'm trying to setup the terminal on my new Mac to match the behavior of my old Mac, however I have run into an issue with my multiline prompt that has me stumped. I remember having this issue when I setup my old Mac several years ago, however I don't remember how I solved it.
My prompt (without color) looks like this:
╭─username ~ 130 ↵
╰─
When I press ⌘commandK in iTerm2 on my old Mac it clears the terminal window so that both lines of the prompt are shown at the top.
When I press ⌘commandK in iTerm2 on my new Mac it clears the terminal window so that only the second line of the prompt is shown at the top.
I have tried checking everything I could think of, I have checked:
Every dot file/directory in my home directory (copied them to the new Mac).
iTerm2 settings.
System settings (primarily keyboard shortcuts).
Various websites with instructions about setting up multi-line prompts.
Interestingly I have discovered that if I type clear iTerm2 will clear the screen and leave the top line showing on both Macs. However it first clears the entire screen, including the prompt, before bringing the prompt back (looks bad imo). However since it works differently ⌘commandK does I don't think that's what my old Mac is doing.
It's possible that I installed some program/script that somehow does this, but if so I'm not finding it locally or referenced online.
Does anyone know how I can get ⌘commandK working to clear the screen while keeping the top line of my prompt? I still have the old Mac so I can check/compare anything on it to the new Mac if there are any guesses about what settings I changed.
Edit:
I was able to find something that worked, however if anyone has any other suggestions I'll be happy to try them and accept any that I can make work that are less hacky than this (e.g. don't require another 3rd party app).
Edit: This doesn't work while a command is running, nor does it clear the scrollable history. So it's better than nothing but still doesn't behave like I want it to.
After coming back to my question SO associated a new question with an answer I was able to make work, although it feels extra hacky and wasn't what I had working before.
I found this answer which suggests using ⌃controlL to clear the screen. That does exactly what I want it to do (leaves the top prompt visible and doesn't flash) but with the wrong keybinding. Fortunately I was able to use an app I already have installed (BTT) to make ⌘commandK map to ⌃controlL only in iTerm2.

wscript.exe stopped working with a custom protocol

All the computers in our company are configured with a custom protocol that runs a vbs script, so when you click on a link with that user protocol, the vbs script starts and performs operations that interact with the file system and applications otherwise inaccessible to the browser.
This is the .reg file used to register the protocol:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\<name>]
"URL Protocol"=""
#="Url:<Description>"
"UseOriginalUrlEncoding"=dword:00000001
[HKEY_CLASSES_ROOT\<name>\DefaultIcon]
#="C:\\Windows\\System32\\WScript.exe"
[HKEY_CLASSES_ROOT\<name>\shell]
[HKEY_CLASSES_ROOT\<name>\shell\open]
[HKEY_CLASSES_ROOT\<name>\shell\open\command]
#="C:\\Windows\\System32\\WScript.exe \"C:\\Program Files\\<name>.vbs\" \"%1\""
The script has worked beautifully since 2014 without problems on ~50 computers.
Last week one user complained that it stopped working. I found out that WScript.exe doesn't work anymore, so I copied it creating WScript2.exe, modified the custom protocol to run WScript2.exe and it restarted working.
This morning also my computer didn't listen to the clicks on my custom protocol. I made a copy of WScript.exe to WScript2.exe and it restarted working.
I am expecting my phone to start ringing soon.
Why did WScript.exe stop listening to the custom protocol?
Why its identical copy still works?
EDIT (answers to comments)
Perhaps if I knew how to better describe "it stopped working" then I would know how to fix it :)
I don't know if it stopped working because of a Microsoft update, an anti-virus update or a change on the IT infrastructure/configuration. Here is a quick summary of what led me to the workaround:
I compared my custom protocol to a working one, I picked mailto as a reference
I noticed that changing the last line of the .reg file (see above) it would work with any other executable, but it wouldn't work with wscript.exe
I compared the execution of wscript.exe on the affected computers to its execution on computers (not yet) affected and there is no difference
A double click shows the same Windows Script Host Settings dialog
The execution from a command prompt with the same arguments used by the custom protocol works as expected
The custom protocol passes the correct arguments when executing another executable
At this point I thought that Windows blacklisted wscript.exe and I started searching for an alternative
I tried to rename wscript.exe to wscript2.exe but I couldn't because I don't have TrustedInstaller permission
I made a copy instead of renaming it
I tested the copy from the command prompt and it was working like the original
I tested the copy from the custom protocol and it was working like the original once did
EDIT 2 (more answers to comments)
All the computers have Windows 10 Pro.
Clicking on Settings - Updates & Security - View update history it says Feature update to Windows 10, version 1803 Succesfully installed on 5/22/2018. Clicking on Show what's new in this update shows nothing useful.
EDIT 3
Doesn't work = no symptoms, nothing happens, nothing is executed, nothing is logged (as far as I know).
I tried with a simple vbscript with a single line MsgBox "Hello". It works running it from the command line, but it doesn't work from the custom protocol. The task manager doesn't show anything popping up, but I don't know if it doesn't show it because the lifespan is too short to show or because it doesn't execute. The same script works with wscript2.exe.
My feeling is that something (Windows, anti-virus, ...) is blacklisting the custom protocol + wscript.exe thing, but not the custom protocol + any other executable or any other environment + wscript.exe. That's why I tried to copy wscript.exe to wscript2.exe. And I was pleasantly surprised to find out that it works.

How to change default Terminal in Source Tree on windows

I am working on Windows 7 with Source Tree. Because I don't like the default cmd.exe I want to change it to Console2 such that Source Tree will open Command2 instead of Cmd as terminal.
It appears you can't do it, at least in any obvious way. There are a couple of solutions/workarounds that you can use here:
Pick a different favorite terminal. ConEmu is a wrapper for CMD.exe that will act as your default terminal if you tell it to [I thought Console2 could do this as well]. Also - forgive the editorial - ConEmu is way, way, better than Console2.
You can add a custom action in the menu. From the global options go to Custom Actions tab and add an action to Open in Terminal using the console you want. This isn't quite as cool as just hitting the terminal icon, but you can easily accomplish the same outcome.
Unfortunately, these are the best there are for now.
Note: Based upon the link that #sendmoreinfo posted, waiting for Atlassian to add this by default may be better way to go for your purposes. Only problem with that may be is that according to some the newest updates to Source tree are terrible, so I haven't updated as of yet.
Note 2: Though this won't do what you want, there is an Option in the settings under the Git Tab that allows you to Set Git Bash as default prompt. That may or may not get you closer to where you want to be.
You may add Windows Terminal as Custom Action. You may run custom action in context of selected file. Define a new custom action as shown below.

Revert shell without using explorer

I've been playing around with a Windows 7 virtual machine and found that by changing the shell registry value in HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\shell I can use an arbitrary program (for example, paint) as the shell instead of explorer.
Now, given that I have no access to the tools afforded by explorer, how would I go about reverting this? This seems like a rather useful trick for demo machines and such, so I would hope that there's a way to revert them when done.
It turns out that keyboard commands (C-S-ESC, C-M-DEL) still work. Surprisingly, windows-r doesn't work. To revert it, open the task manager using C-S-ESC, then click new task, then you can either run explorer to start the gui shell, or regedit to change the default shell.

Update desktop "show window contents while dragging" setting programatically

One of my programs seems to be changing the Display Properties > Appearance > Effects > Show window contents while dragging setting to off every few hours.
I'm not sure exactly which program, or when it happens. I have a number of programs that seem like likely culprits - wallpaper rotators, software for multiple monitors, multiple virual desktops and switching, and a few others.
I am just thinking to create a little batch script to run periodically and set the setting back to on.
Does anyone know how to do this in windows? I'm using xp pro sp3.
Thanks!
The best option is to do this programmatically using the supported API. i haven't tested this, but it should do the trick:
SystemParametersInfo(SPI_SETDRAGFULLWINDOWS,
TRUE,
NULL,
SPIF_UPDATEINIFILE | SPIF_SENDCHANGE)
You can use SPI_GETDRAGFULLWINDOWS to see if the the bit has been flipped to avoid unnecessarily triggering a WM_SETTINGCHANGE.
You can use RegMon to find the program that keeps changing your settings. Maybe that's a better start than hacking around it.
There is a simple and effective solution to this problem. In Notepad type the following lines :
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\Desktop] "DragFullWindows"="1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows] "CheckedValue"=dword:00000001 "UncheckedValue"=dword:00000001
Save the file as "Show Window Contents.reg" Double clicking this file and restarting will cure the problem permanently. Post a message if you find this useful.
Aravind Banerjee
It seems the registry setting which controls that preference is HKCU\Control Panel\Desktop\DragFullWindows. You can read more about it here. However, trying it on my own computer does not register the change right away, so a batch script won't do it. You'll probably have to write a program to manipulate it using SystemParametersInfo(). You can pass it the SPI_SETDRAGFULLWINDOWS parameter. Here's a page explaining it more. Here's a page showing how to call it, albeit not for the same parameter.
I suspect it's kept in the registry - maybe [HKEY_CURRENT_USER\Control Panel\Desktop] - "DragFullWindows"?
It would be easy to flip the registry setting back to "1" every hour or so with a batch file.

Resources