microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.55k stars 8.31k forks source link

Guide for build and installation #489

Closed ZgblKylin closed 5 years ago

ZgblKylin commented 5 years ago

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 3, can be found in Terminal/dep/nuget).

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 src/tools/vtpipeterm/main.cpp: In addtion, you should also add u8 prefix before string literals with unicode characters, e.g. 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, and 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"
}
kev-landry commented 5 years ago

Thank you.

yanke1311 commented 5 years ago

thanks!

ShrinkWrapper commented 5 years ago

Thanks a bunch!

ecampidoglio commented 5 years ago

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

pavelovcharov commented 5 years ago

Windows 1903 is required to deploy Windows Terminal https://github.com/microsoft/Terminal/issues/437#issuecomment-489899822

AregevDev commented 5 years ago

Can I build it with VS 2019?

NikolausWeiss commented 5 years ago

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 commented 5 years ago

Same as you

HowBoring commented 5 years ago

Can I build it with VS 2019?

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

AregevDev commented 5 years ago

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

clearcodecn commented 5 years ago

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

DarryNobi commented 5 years ago

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 commented 5 years ago

There is a pull request for a branch that fixes the VS 2019 errors: https://github.com/microsoft/Terminal/pull/449

Berrysoft commented 5 years ago

Can I build it with VS 2019?

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

noobhacker commented 5 years ago

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.

ob1231 commented 5 years ago

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

pulimento commented 5 years ago

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

Berrysoft commented 5 years ago

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

The solution (top one) in the Solution Explorer.

noobhacker commented 5 years ago

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

image

AregevDev commented 5 years ago

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

ob1231 commented 5 years ago

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

image

thanks a lot

Aarklendoia commented 5 years ago

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 commented 5 years ago

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

zhouchaoyuan commented 5 years ago

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

joj commented 5 years ago

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

hjc2024 commented 5 years ago

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 commented 5 years ago

To peoples who really want to try out but failed to build: https://github.com/microsoft/Terminal/issues/468#issuecomment-489967072

Mika-Lahtinen commented 5 years ago

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

AregevDev commented 5 years ago

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 )

I used a fork that sent the fix to vs2019, built without problems

AregevDev commented 5 years ago

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

use .\dep\nuget\nuget ...

iBalance94 commented 5 years ago

Does anyone know how to solve the error about the windows version? My window's current version is 17763, but the requirement is higher.

zadjii-msft commented 5 years ago

@hengbu the solution is to upgrade to an Insider's build of Windows, or wait until 1903 reaches general availability. We require some features that are only available in the latest version of Windows.

y0d4a commented 5 years ago

always getting those errors: Severity Code Description Project File Line Suppression State Error C1083 Cannot open include file: 'wil/Common.h': No such file or directory WindowsTerminal C:\Users\yoda\Downloads\Terminal-master\src\inc\LibraryIncludes.h 46

DHowett-MSFT commented 5 years ago

@y0d4a you should do the submodules thing in the README...

Hazix00 commented 5 years ago

can someone just give us the build

glen-84 commented 5 years ago

@HamzaT1992 https://github.com/microsoft/Terminal/issues/468#issuecomment-490105048.

zadjii-msft commented 5 years ago

This is now the megathread for all build issues.

ghost commented 5 years ago

This is now the megathread for all build issues.

So I think it can be pinned because a lot of people can not build it smoothly

ankitbko commented 5 years ago

Managed to run it in VS2019 without code change or retargeting to v142. I replied in issue #461 but mentioning it here as well - Followed this to install WinRT and then right-clicked on solution -> install missing feature.

Can someone else also try and see if this works? I can share screenshot of all the packages installed in my VS.

nbsriharsha commented 5 years ago

I am getting this error

image

audac1ty commented 5 years ago

Ran through the tutorial seen here, also updated to the latest insider build of windows. Had to perform a lot of modifications to my VSCode environment and added a lot of build tools but it compiled and it running. Thanks for this!

Vargnatt commented 5 years ago

Anyone know how to solve Win 10 SDK version issue? I am using VS 2017 and manually downloaded 1903 version SDK, but still, it deploys with error

DEP3321: To deploy this application, your deployment target should be running Windows Universal Runtime version 10.0.18362.0 or higher. You currently are running version 10.0.17763.475.

audac1ty commented 5 years ago

I am getting this error

image

You must be running Windows 1903 (build >= 10.0.18362.0) or above in order to run Windows Terminal

audac1ty commented 5 years ago

Anyone know how to solve Win 10 SDK version issue? I am using VS 2017 and manually downloaded 1903 version SDK, but still, it deploys with error

DEP3321: To deploy this application, your deployment target should be running Windows Universal Runtime version 10.0.18362.0 or higher. You currently are running version 10.0.17763.475.

You must be running Windows 1903 (build >= 10.0.18362.0) or above in order to run Windows Terminal

nbsriharsha commented 5 years ago

@audac1ty image It shows my windows is up-to-date. I am using Windows 10 Home edition. Do we need to update it manually?

kianryan commented 5 years ago

Building doesn't work if there are spaces in the path to the project. Error is in the CppCommon.targets files, Exec Command=", it just really doesn't like executing the full path I think.

Collapse the path to something more straightforward, and it behaves itself a bit better. Somewhere in all the tidying, there may need to be some path escaping somewhere, but workaroundable for now.

itzjustzee commented 5 years ago

for all the people who cant see the Tabs/Dropdown after they have built and run, replace the standard Profiles.json text with:

{"defaultProfile":"{00d9ddc0-fab3-49ad-90ab-64ef755bef22}","initialRows":30,"initialCols":120,"alwaysShowTabs":true,"showTerminalTitleInTitlebar":true,"experimental_showTabsInTitlebar":false,"profiles":[{"guid":"{00d9ddc0-fab3-49ad-90ab-64ef755bef22}","name":"cmd","colorscheme":"Campbell","historySize":9001,"snapOnInput":true,"cursorColor":"#FFFFFF","cursorShape":"bar","commandline":"cmd.exe","fontFace":"Consolas","fontSize":12,"acrylicOpacity":0.75,"useAcrylic":true,"closeOnExit":false,"padding":"0, 0, 0, 0"},{"guid":"{3b50b48f-7c60-4f89-9469-4537029153e4}","name":"PowerShell","colorscheme":"Campbell","historySize":9001,"snapOnInput":true,"cursorColor":"#FFFFFF","cursorShape":"bar","commandline":"powershell.exe","fontFace":"Courier New","fontSize":12,"acrylicOpacity":0.75,"useAcrylic":true,"closeOnExit":false,"padding":"0, 0, 0, 0"}],"schemes":[{"name":"Campbell","foreground":"#F2F2F2","background":"#0C0C0C","colors":["#0C0C0C","#C50F1F","#13A10E","#C19C00","#0037DA","#881798","#3A96DD","#CCCCCC","#767676","#E74856","#16C60C","#F9F1A5","#3B78FF","#B4009E","#61D6D6","#F2F2F2"]},{"name":"Solarized Dark","foreground":"#FDF6E3","background":"#073642","colors":["#073642","#D30102","#859900","#B58900","#268BD2","#D33682","#2AA198","#EEE8D5","#002B36","#CB4B16","#586E75","#657B83","#839496","#6C71C4","#93A1A1","#FDF6E3"]},{"name":"Solarized Light","foreground":"#073642","background":"#FDF6E3","colors":["#073642","#D30102","#859900","#B58900","#268BD2","#D33682","#2AA198","#EEE8D5","#002B36","#CB4B16","#586E75","#657B83","#839496","#6C71C4","#93A1A1","#FDF6E3"]}]}

alternatively just find and replace ("alwaysShowTabs":false) to true

AndrewGong2016 commented 5 years ago

严重性 代码 说明 项目 文件 行 禁止显示状态 错误 MSB8020 无法找到 v142 的生成工具(平台工具集 =“v142”)。若要使用 v142 生成工具进行生成,请安装 v142 生成工具。或者,可以升级到当前 Visual Studio 工具,方式是通过选择“项目”菜单或右键单击该解决方案,然后选择“重定解决方案目标”。 PropertiesLibrary D:\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets 67
could someone help me? I am new here

audac1ty commented 5 years ago

@audac1ty image It shows my windows is up-to-date. I am using Windows 10 Home edition. Do we need to update it manually?

Have you upgraded to the latest windows insider build? It should be 10.0.18362

perryizgr8 commented 5 years ago

Can someone host a binary for Win10 64 bit? I wonder why they haven't made a release yet?