Fine-Tuning Windows Terminal

by Nov 10, 2020

Categories

Tags

Administration agent-based monitoring Agentless Monitoring alert responses alert thresholds alerting Alerts Amazon Aurora Amazon EC2 Amazon RDS Amazon RDS / Aurora Amazon RDS for SQL Server Amazon Redshift Amazon S3 Amazon Web Services (AWS) Analytics application monitoring Aqua Data Studio automation availability Azure Azure SQL Database azure sql managed instance Azure VM backup Backup and recovery backup and restore backup compression backup status Backup Strategy backups big data Blocking bug fixes business architecture business data objects business intelligence business process modeling business process models capacity planning change management cloud cloud database cloud database monitoring cloud infrastructure cloud migration cloud providers Cloud Readiness Cloud Services cloud storage cloud virtual machine cloud VM clusters code completion collaboration compliance compliance audit compliance audits compliance manager compliance reporting conference configuration connect to database cpu Cross Platform custom counters Custom Views customer survey customer testimonials Dark Theme dashboards data analysis Data Analytics data architect data architecture data breaches Data Collector data governance data lakes data lineage data management data model data modeler data modeling data models data privacy data protection data security data security measures data sources data visualization data warehouse database database administration database administrator database automation database backup database backups database capacity database changes database community database connection database design database developer database developers database development database diversity Database Engine Tuning Advisor database fragmentation database GUI database IDE database indexes database inventory management database locks database management database migration database monitoring database navigation database optimization database performance Database Permissions database platforms database profiling database queries database recovery database replication database restore database schema database security database support database synchronization database tools database transactions database tuning database-as-a-service databases DB Change Manager DB Optimizer DB PowerStudio DB2 DBA DBaaS DBArtisan dBase DBMS DDL Debugging defragmentation Demo diagnostic manager diagnostics dimensional modeling disaster recovery Download drills embedded database Encryption End-user Experience entity-relationship model ER/Studio ER/Studio Data Architect ER/Studio Enterprise Team Edition events execution plans free tools galera cluster GDPR Getting Started Git GitHub Google Cloud Hadoop Healthcare high availability HIPAA Hive hybrid clouds Hyper-V IDERA IDERA ACE Index Analyzer index optimization infrastructure as a service (IaaS) infrastructure monitoring installation Integrated Development Environment interbase Inventory Manager IT infrastructure Java JD Edwards JSON licensing load test load testing logical data model macOS macros managed cloud database managed cloud databases MariaDB memory memorystorage memoryusage metadata metric baselines metric thresholds Microsoft Azure Microsoft Azure SQL Database Microsoft PowerShell Microsoft SQL Server Microsoft Windows MongoDB monitoring Monitoring Tools Monyog multiple platforms MySQL news newsletter NoSQL Notifications odbc optimization Oracle PeopleSoft performance Performance Dashboards performance metrics performance monitoring performance schema performance tuning personally identifiable information physical data model Platform platform as a service (PaaS) PostgreSQL Precise Precise for Databases Precise for Oracle Precise for SQL Server Precise Management Database (PMDB) product updates Project Migration public clouds Query Analyzer query builder query monitor query optimization query performance Query Store query tool query tuning query-level waits Rapid SQL rdbms real time monitoring Real User Monitoring recovery regulations relational databases Releases Reporting Reports repository Restore reverse engineering Roadmap sample SAP Scalability Security Policy Security Practices server monitoring Server performance server-level waits Service Level Agreement SkySQL slow query SNMP snowflake source control SQL SQL Admin Toolset SQL CM SQL code SQL coding SQL Compliance Manager SQL Defrag Manager sql development SQL Diagnostic Manager SQL Diagnostic Manager for MySQL SQL Diagnostic Manager for SQL Server SQL Diagnostic Manager Pro SQL DM SQL Doctor SQL Enterprise Job Manager SQl IM SQL Inventory Manager SQL Management Suite SQL Monitoring SQL Performance SQL Quality SQL query SQL Query Tuner SQL Safe Backup SQL script SQL Secure SQL Security Suite SQL Server sql server alert SQL Server Migration SQL Server Performance SQL Server Recommendations SQL Server Security SQL statement history SQL tuning SQL Virtual Database sqlmemory sqlserver SQLyog Storage Storage Performance structured data Subversion Support tempdb tempdb data temporal data Tips and Tricks troubleshooting universal data models universal mapping unstructured data Uptime Infrastructure Monitor user experience user permissions Virtual Machine (VM) web services webinar What-if analysis WindowsPowerShell

In the previous tips we explained how you can install „Windows Terminal“ on Windows 10 via the Microsoft Store. Windows Terminal features PowerShell consoles in separate tabs and is very useful.

You can control the types of consoles available in the tab drop-down list by editing the settings file: in Windows Terminal, in the title bar click the down arrow button, and choose „Settings“. This opens a JSON file in your associated editor. If no editor is associated with JSON files, you can pick one or revert to Notepad.

The „profiles“ section lists the console types you can open in Windows Terminal using the „down arrow“ button. Here is an example:

 
"profiles":
    {
        "defaults":
        {
            // Put settings here that you want to apply to all profiles.
        },
        "list":
        [
            {
                // Make changes here to the powershell.exe profile.
                "guid""{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name""Windows PowerShell",
                "commandline""powershell.exe",
                "hidden"false,
                "useAcrylic"true,
        "acrylicOpacity" : 0.8,
            },
            {
                // Make changes here to the cmd.exe profile.
                "guid""{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name""Command Shell",
                "commandline""cmd.exe",
                "hidden"false,
                "useAcrylic"true,
        "acrylicOpacity" : 0.8,
            },
            {
                "guid""{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "hidden"false,
                "name""PowerShell",
                "source""Windows.Terminal.PowershellCore",
                "useAcrylic"true,
        "acrylicOpacity" : 0.8,
            },
            {
                "guid""{2595cd9c-8f05-55ff-a1d4-93f3041ca67f}",
                "hidden"false,
                "name""PowerShell Preview (msix)",
                "source""Windows.Terminal.PowershellCore",
                "useAcrylic"true,
        "acrylicOpacity" : 0.8,
            },
            {
                "guid""{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "hidden"false,
                "name""Azure Cloud Shell",
                "source""Windows.Terminal.Azure",
                "useAcrylic"true,
        "acrylicOpacity" : 0.8,
            },
            {
                "guid""{0caa0dae-35be-5f56-a8ff-afceeeaa6101}",
                "name""Terminal As Admin",
                "commandline""powershell.exe -command start 'C:/wt/wt.exe' -verb runas",
                "icon""ms-appx:///Images/Square44x44Logo.targetsize-32.png",
                "hidden"false
            },
            {
                "guid""{0ca30dae-35be-5f56-a8ff-afceeeaa6101}",
                "name""ISE Editor",
                "commandline""powershell.exe -command powershell_ise",
                "icon""c:/wt/ise.ico",
                "hidden"false
            },
            {
                "guid""{b39ac7db-ace0-4165-b312-5f2dfbbe4e4d}",
                "name""VSCode",
                "commandline""cmd.exe /c \"%LOCALAPPDATA%/Programs/Microsoft VS Code/code.exe\"",
                "icon""c:/wt/vscode.ico",
                "hidden"false
            }
        ]
    }
 

As you see, you can define a path to any executable, and with options like „useAcrylic“ and „acrylicOpacity“ you can control transparency.

Take a look at the entries towards the end of the list: they illustrate how you can use the drop down menu to launch external programs like editors (VSCode, ISE), or even open Windows Terminal with Administrator privileges.

The trick is to launch external applications with either „cmd.exe /c“ or „powershell“. If you launch external applications directly, this would result in a blank tab window that remains open until the external application is closed again.

Note also how you can add your favorite icons to list entries: use „icon“ and submit a bitmap or ico file. In an upcoming tip we show how you can create such icon files via PowerShell code.

If you plan to add new entries to the list, keep in mind that each entry needs a unique GUID. In PowerShell, use New-Guid to create one.

Once you save the JSON file, the edits take effect immediately. If the JSON edits you made damage the file or introduce syntax errors (such as unbalanced quotes etc), Windows Terminal will complain. It is a good idea to make a backup copy before you edit, and use an editor like VSCode that supports JSON format and assist you by pointing you to syntax errors.


Twitter This Tip! ReTweet this Tip!