Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guide for build and installation #489

Open
ZgblKylin opened this issue May 7, 2019 · 211 comments

Comments

Projects
None yet
@ZgblKylin
Copy link

commented May 7, 2019

Tools needed

  1. VS2017 or higher with the following packages ("Workloads" tab in Visual Studio Installer) :
    1.1 "Desktop Development with C++"
    1.2 "Universal Windows Platform Development"
    1.3 Windows 10 SDK (10.0.18362.0)
    1.4 If you're running VS2019, you'll also need to install either "v141 Toolset" or v142 Toolset
  2. Git command-line tool
  3. Nuget.exe (Needed in build step 2, can be found in Terminal/dep/nuget)
  4. Win10 1903 SDK (build 10.0.18362.0)

Build Steps

  1. git clone this repository, not download .zip file.
  2. Run git submodule update --init --recursive in Terminal folder
  3. Run nuget restore OpenConsole.sln (This step can be skipped, then Visual Studio should warn you that there are packages to restore - then restore)
  4. Open OpenConsole.sln with Visual Studio
  5. build whole solution(F7) with your platform(x86/x64) and release mode, you may need to fix some build errors:
    5.1 C2220 and code page warnings: All errors and warnings are encoding error of unicode characters, a helpful workaround is to modify corresponding file encoding to UTF-8 BOM (Notepad++ is recommended)
    5.2 Errors in main.cpp: In addtion, you should also add u8 prefix before string literals in line 395, 398, 401 and 404

Workaround

Try build with PR 458 or PR 549, both of them can build successfully.

Installation

Unfortunately, the generated .appx doesn't have any certificates, so it cannot be installed via double-click or powershell, the only way to install is to deploy the solution in VS.

  1. Open Windows Settings - Upgrade & Security - For Developers, switch App sources to Developer mode
  2. Right click on CascadiaPackage project (under Solution/Terminal), select Deploy Solution to install, then you'll find Windows Terminal (Preview) in start menu

Settings

After open the terminal, you can't see any menu buttons.

Just press Ctrl + T to open a new tab, then you'll see a drop-down button in the tab bar.

Click it and select Settings, then you can modify the configuration via opened profiles.json.

Add WSL

  1. Create a new session in profiles, with content copied from profiles/cmd
  2. Give it a new guid
  3. Give it a new name, such as WSL
  4. Specify its commandline to wsl.exe

Then you'll find WSL in the drop-down menu of tab bar.

Here're sample codes:

{
    "guid": "{09dc5eef-6840-4050-ae69-21e55e6a2e62}",
    "name": "WSL",
    "colorscheme": "Campbell",
    "historySize": 9001,
    "snapOnInput": true,
    "cursorColor": "#FFFFFF",
    "cursorShape": "bar",
    "commandline": "wsl.exe",
    "fontFace": "Consolas",
    "fontSize": 12,
    "acrylicOpacity": 0.75,
    "useAcrylic": true,
    "closeOnExit": false,
    "padding": "0, 0, 0, 0"
}

@ZgblKylin ZgblKylin changed the title Instruction for build new Terminal Guide for build new Terminal May 7, 2019

@kev-landry

This comment has been minimized.

Copy link

commented May 7, 2019

Thank you.

@yanke1311

This comment has been minimized.

Copy link

commented May 7, 2019

thanks!

@SilentFez

This comment has been minimized.

Copy link

commented May 7, 2019

Thanks a bunch!

@ecampidoglio

This comment has been minimized.

Copy link

commented May 7, 2019

This information should be included in the Building the Code section of the README file.

@pavelovcharov

This comment has been minimized.

Copy link

commented May 7, 2019

Windows 1903 is required to deploy Windows Terminal
#437 (comment)

@AregevDev

This comment has been minimized.

Copy link

commented May 7, 2019

Can I build it with VS 2019?

@NikolausWeiss

This comment has been minimized.

Copy link

commented May 7, 2019

Can I build it with VS 2019?

I've been trying for a few hours with no success. I have given up and am currently installing VS 2017

@AregevDev

This comment has been minimized.

Copy link

commented May 7, 2019

Same as you

@Code7thDay

This comment has been minimized.

Copy link

commented May 7, 2019

Can I build it with VS 2019?

I'm afraid you can't, I have got 23 FAILED to build with VS2019...

@AregevDev

This comment has been minimized.

Copy link

commented May 7, 2019

Thanks! I am installing VS2017, can't wait to try the new Terminal out!

@clearcodecn

This comment has been minimized.

Copy link

commented May 7, 2019

hello. can I download the binary file of you build ? I don`t want to build it . no environment . 😆

@DarryNobi

This comment has been minimized.

Copy link

commented May 7, 2019

Can I build it with VS 2019?

I've been trying for a few hours with no success. I have given up and am currently installing VS 2017

Me, neither. Better try on VS2017 directly. \cry

@NikolausWeiss

This comment has been minimized.

Copy link

commented May 7, 2019

There is a pull request for a branch that fixes the VS 2019 errors: #449

@Berrysoft

This comment has been minimized.

Copy link

commented May 7, 2019

Can I build it with VS 2019?

Yes, with hours of patience, and fixing many bugs.

@noobhacker

This comment has been minimized.

Copy link

commented May 7, 2019

There is a pull request for a branch that fixes the VS 2019 errors: #449

That single line of code worked for me in VS2019. I'm now installing insider build to get to 1903 or above.

@gloomfrog

This comment has been minimized.

Copy link

commented May 7, 2019

what dos the 'solution' mean exactly in step5, i'm new here

@pulimento

This comment has been minimized.

Copy link

commented May 7, 2019

So, still, you need an insider build, right?

@Berrysoft

This comment has been minimized.

Copy link

commented May 7, 2019

what dos the 'solution' mean exactly in step5, i'm new here

The solution (top one) in the Solution Explorer.

@noobhacker

This comment has been minimized.

Copy link

commented May 7, 2019

what dos the 'solution' mean exactly in step5, i'm new here

image

@AregevDev

This comment has been minimized.

Copy link

commented May 7, 2019

I successfully built it, but wanted to ask, are all the features shown in the video implemented? I can only see the new UWP based console

@gloomfrog

This comment has been minimized.

Copy link

commented May 7, 2019

what dos the 'solution' mean exactly in step5, i'm new here

image

thanks a lot

@Aarklendoia

This comment has been minimized.

Copy link

commented May 7, 2019

To compile, you also need to install the "Universal Windows Platform Tools" (not installed by default).

For me, TerminalCore and Unittests_TerminalCode can't be loaded, I don't know why. The file common.build.pre.props can't be loaded...

@martinmine

This comment has been minimized.

Copy link

commented May 7, 2019

This should be in the readme.md-file, maybe you should open a PR for this @ZgblKylin ? :)

@zhouchaoyuan

This comment has been minimized.

Copy link

commented May 7, 2019

========== Build: 0 succeeded, 45 failed, 2 up-to-date, 0 skipped ==========

@joj

This comment has been minimized.

Copy link
Member

commented May 7, 2019

Is there a way to do that from command prompt? /t:Deploy doesn't do anything on the solution.

@gencool

This comment has been minimized.

Copy link

commented May 7, 2019

Thanks! I am installing VS2017, can't wait to try the new Terminal out!

hope you have succeed, I am doing this now (I have spend half a day on VS2019 )

@noobhacker

This comment has been minimized.

Copy link

commented May 7, 2019

To peoples who really want to try out but failed to build:
#468 (comment)

@Mika-Lahtinen

This comment has been minimized.

Copy link

commented May 7, 2019

When I used Git bash,I was told bash:nuget:command not found
How to solve it?

@MichaelE919

This comment has been minimized.

Copy link

commented May 18, 2019

There are several header files which have the line "#include <Windows.h>", sometimes with a "windows.h." This file doesn't exist in the repo. Did Windows.h get replaced with another file?

@DHowett-MSFT

This comment has been minimized.

Copy link
Member

commented May 18, 2019

Huh? windows.h is part of the Windows SDK. It has been for about a hundred years.

@dantenull

This comment has been minimized.

Copy link

commented May 18, 2019

Hey I ran into this issue as well and resolved it by deleting any saved settings and allowing the app to regenerate them.

I went to the following location

%LOCALAPPDATA%\packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\RoamingState
may also be %LOCALAPPDATA%\packages\Microsoft.WindowsDevTerminal_8wekyb3d8bbwe\RoamingState

and deleted any profiles.json file located there and relaunched the app.

@drekryan Thank you.I tried and didn't make the mistake last time.But it didn't run correctly.I can't use it.

@iamdarknight

This comment has been minimized.

@jduartedj

This comment has been minimized.

Copy link

commented May 20, 2019

I was redirected here because of atlbase files missing but since the other thread was closed I wasn't able to see the resolution directly.
FYI: to newcomers with atlbase issue you need to install the ATL v142 (for me at this moment). Quoting it:

In Visual Studio, you can go to Tools->Get Tools and Features, which will open the Visual Studio Installer. From there you can click the Modify button for your Visual Studio version, then go to the Individual Components tab at the top. The C++ ATL components are in the section titled "SDKs, libraries, and frameworks" which is the last section in my list at least.

Fair warning, I had to install the V141 versions to get the atlbase error to go away, not the V142 versions in the picture.

@zugazagoitia

This comment has been minimized.

Copy link

commented May 20, 2019

I'm getting the following error:

Details

"C:\Users\Alberto Zugazagoitia\Documents\GitHub\Terminal\OpenConsole.sln" (default target) (1) ->
"C:\Users\Alberto Zugazagoitia\Documents\GitHub\Terminal\src\host\ft_uia\Host.Tests.UIA.csproj.metaproj" (default targe
t) (34) ->
"C:\Users\Alberto Zugazagoitia\Documents\GitHub\Terminal\src\host\ft_uia\Host.Tests.UIA.csproj" (default target) (37) -

(PostBuildEvent target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.ta
rgets(5179,5): error MSB3073: The command "copy C:\Users\Alberto Zugazagoitia\Documents\GitHub\Terminal\dep\WinAppDriv
er* C:\Users\Alberto Zugazagoitia\Documents\GitHub\Terminal\bin\x64\Release\" exited with code 1. [C:\Users\Alberto
Zugazagoitia\Documents\GitHub\Terminal\src\host\ft_uia\Host.Tests.UIA.csproj]

It may have to do with the path double slashes, how can i get this solved?

@PatrykZajac

This comment has been minimized.

Copy link

commented May 20, 2019

I try to solve my problem, but I don't know what I make incorrect. I have error like:
Severity Code Description Project File Line Suppression State Error C1007 unrecognized flag '-Yu' in 'p2' TerminalControl C:\Terminal\src\cascadia\TerminalControl\LINK 1 Error LNK1257 code generation failed TerminalControl C:\Terminal\src\cascadia\TerminalControl\LINK 1 Error C1007 unrecognized flag '-Yu' in 'p2' TerminalApp C:\Terminal\src\cascadia\TerminalApp\LINK 1 Error LNK1257 code generation failed TerminalApp C:\Terminal\src\cascadia\TerminalApp\LINK 1
Can anyone tell me what I make wrong?

@drekryan

This comment has been minimized.

Copy link

commented May 20, 2019

@PatrykZajac are you using the latest Windows 10 SDK (10.0.18362.0). Be sure it’s downloaded then retarget your solution to use this version of the SDK

@PatrykZajac

This comment has been minimized.

Copy link

commented May 20, 2019

@PatrykZajac are you using the latest Windows 10 SDK (10.0.18362.0). Be sure it’s downloaded then retarget your solution to use this version of the SDK

I upgraded windows to 1903 and now it's works. Thanks

@plop28

This comment has been minimized.

Copy link

commented May 21, 2019

This is really fun. The green glow is awesome.

Can't wait to really dive into the code and get some things working.

Next order of business is to change the tab labels to the profile name.

image
Nice, what theme or color did you used ?

@Spazattack4life

This comment has been minimized.

Copy link

commented May 21, 2019

For all you having issues, I found this helpful. https://www.youtube.com/watch?v=4Rsr0NRHuBY

However, I can open the "Ubuntu Terminal" but nothing works, any clue on how to start troubleshooting this, kinda new and figured this would be a good way to start learning, guess I walked off a cliff, now im in over my head.

@tensor-programming

This comment has been minimized.

Copy link

commented May 22, 2019

Was able to build this thing easily enough with cmd/powershell but what about deployment? I really don't want to have to install VS and then the 11.6 gigs worth of tools that I already have just to make it run

@mKay00

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

For all you having issues, I found this helpful. https://www.youtube.com/watch?v=4Rsr0NRHuBY

However, I can open the "Ubuntu Terminal" but nothing works, any clue on how to start troubleshooting this, kinda new and figured this would be a good way to start learning, guess I walked off a cliff, now im in over my head.

What do you mean with "but nothing works"? Be a bit more specific than that.

@tensor-programming As far as I know you need to use VS to deploy it. Or you wait for the release in the store, which is planned for June.

@derek-s

This comment has been minimized.

Copy link

commented May 22, 2019

i successful deploy on my pc, thank you all

@Sapphiress

This comment has been minimized.

Copy link

commented May 23, 2019

Anyone know how I can fix these errors when trying to compile?
image

Update: Apparently VS lied to me and its installed and running fine.

@fredrikaverpil

This comment has been minimized.

Copy link

commented May 23, 2019

With VS2019, here is how you can install all deps from the Powershell commandline (which will launch the installer UI):

& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installershell.exe" `
    modify `
    --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" `
    --passive --norestart `
    --add Microsoft.VisualStudio.Workload.NativeDesktop `
    --add Microsoft.VisualStudio.Workload.Universal `
    --add Microsoft.VisualStudio.Component.Windows10SDK.18362 `
    --add Microsoft.VisualStudio.ComponentGroup.UWP.Support `
    --add Microsoft.Component.VC.Runtime.OSSupport `
    --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 `
    --add Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141 `
    --add Microsoft.VisualStudio.Component.VC.v141.ATL `
    --add Microsoft.VisualStudio.Component.VC.v141.MFC

You may have to change the paths above depending on where your VS2019 is installed.

I jotted down my build/deploy notes on my blog: https://fredrikaverpil.github.io/2019/05/12/building-windows-terminal/

@jackluo923

This comment has been minimized.

Copy link

commented May 23, 2019

After deployment, Windows Terminal (Dev Build) showed up instead of Windows Terminal (Preview). After opening Windows Terminal (Dev Build), powershell popped up rather than Windows Terminal. Any fix to this problem?

@xpwn3rx

This comment has been minimized.

Copy link

commented May 23, 2019

I'm sorry, but if you read the instructions or the documentation you would know that is how it works. The tabs don't show up until you press CTRL+T or you force them on in the configuration json file.

@jackluo923

This comment has been minimized.

Copy link

commented May 23, 2019

Thanks for the clarification. I was expecting the GUI screenshot from few post up, but the resulting GUI was different. I guess the default GUI for the windows terminal looks exactly like powershell (which after thinking about it should be the correct behavior).
Capture
image

FYI: To make the title bar disappear, you'll need to take a look at this feature request:
#433

@kodaman2

This comment has been minimized.

Copy link

commented May 24, 2019

Followed build steps, opened snl project, update to V142 (Do not skip step 3 if you are having issues)

If I skip step3:
Opening with Visual Studio 2019, installed missing components, and it didn't want to restore nugets even when settings were correct and even when I manually restore nugets on cmd prompt they were already up to date, build failed every time. So do not skip step 3 if you are having issues with nuget restore in visual studio is a known bug.

@kodaman2

This comment has been minimized.

Copy link

commented May 24, 2019

@Code7thDay Yes you can, I just did. Don't skip step 3. VS2019 has a bug with nuget restore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.