Windows terminal starting directory

Устранение неполадок в Терминале Windows Troubleshooting in Windows Terminal

В этом руководстве рассматриваются некоторые распространенные ошибки и препятствия, которые могут возникнуть при использовании Терминала Windows. This guide addresses some of the common errors and obstacles you may encounter when using Windows Terminal.

Настройте дистрибутив WSL для запуска в корневом каталоге

Set your WSL distribution to start in the home

directory when launched

По умолчанию startingDirectory профиля является %USERPROFILE% ( C:\Users\ ). By default, the startingDirectory of a profile is %USERPROFILE% ( C:\Users\ ). Это путь в Windows. This is a Windows path. Однако для WSL вместо этого может потребоваться использование пути к основной папке WSL. For WSL, however, you may want to use the WSL home path instead. startingDirectory принимает только путь в стиле Windows, поэтому для запуска в дистрибутиве WSL требуется префикс. startingDirectory only accepts a Windows-style path, so setting it to start within a WSL distribution requires a prefix.

Начиная с Windows 10 версии 1903, запросы в файловые системы дистрибутивов WSL можно выполнять, используя префикс \\wsl$\ . Beginning in Windows 10 version 1903, the file systems of WSL distributions can be addressed using the \\wsl$\ prefix. Для любого дистрибутива WSL с именем DistroName используйте \\wsl$\DistroName в качестве пути Windows, указывающего на корень файловой системы этого дистрибутива. For any WSL distribution with the name DistroName , use \\wsl$\DistroName as a Windows path that points to the root of that distribution’s file system.

Например, следующий параметр запустит дистрибутив Ubuntu-18.04 в пути к основной папке: For example, the following setting will launch the «Ubuntu-18.04» distribution in its home file path:

Задание заголовка вкладки Setting the tab title

Сведения о настройке автоматического задания заголовка вкладки оболочкой см. в этом руководстве. To have the shell automatically set your tab title, visit the set the tab title tutorial. Если вы хотите задать собственный заголовок вкладки, откройте файл SETTINGS.JSON и выполните следующие действия: If you want to set your own tab title, open the settings.json file and follow these steps:

В профиле для выбранной командной строки добавьте «suppressApplicationTitle»: true , чтобы подавлять события изменения заголовка, отправляемые из оболочки. In the profile for the command line of your choice, add «suppressApplicationTitle»: true to suppress any title change events that get sent from the shell. При добавлении только этого параметра в профиль для заголовка вкладки задается имя вашего профиля. Adding only this setting to your profile will set the tab title to the name of your profile.

Если вам необходим пользовательский заголовок вкладки, который не является именем профиля, добавьте «tabTitle»: «TITLE» . If you want a custom tab title that is not the name of your profile, add «tabTitle»: «TITLE» . Замените TITLE необходимым заголовком вкладки. Replacing «TITLE» with your preferred tab title.

Читайте также:  Driver updater pro для windows

Аргументы командной строки в PowerShell Command line arguments in PowerShell

Сведения о функционировании аргументов командной строки в PowerShell см. на этой странице. Visit the Command line arguments page to learn how command-line arguments operate in PowerShell.

Аргументы командной строки в WSL Command line arguments in WSL

Сведения о функционировании аргументов командной строки в WSL см. на этой странице. Visit the Command line arguments page to learn how command-line arguments operate in WSL.

Проблема при настройке startingDirectory Problem setting startingDirectory

Если startingDirectory игнорируется в профиле, сначала убедитесь в правильности синтаксиса SETTINGS.JSON. If the startingDirectory is being ignored in your profile, first check to make sure your settings.json’s syntax is correct. Для выполнения проверки синтаксиса автоматически внедряется схема «$schema»: «https://aka.ms/terminal-profiles-schema» . To help you check this syntax, «$schema»: «https://aka.ms/terminal-profiles-schema» is automatically injected. Некоторые приложения, например Visual Studio Code, могут использовать эту схему для проверки JSON-файла при внесении изменений. Some applications, like Visual Studio Code, can use that injected schema to validate your json file as you make edits.

Если параметры верны, возможно, выполняется сценарий запуска, который задает начальный каталог терминала отдельно. If your settings are correct, you may be running a startup script that sets the starting directory of your terminal separately. Например, PowerShell имеет собственную отдельную концепцию профилей. For example, PowerShell has its own separate concept of profiles. Изменение в ней начального каталога приоритетнее определения параметра в Терминале Windows. If you are changing your starting directory there, it will take precedence over the setting defined in Windows Terminal.

Кроме того, при запуске сценария с помощью параметра профиля commandline вы могли задать в нем расположение. Alternatively, if you are running a script using the commandline profile setting, it may be that you are setting the location there. Как и в случае с профилями PowerShell, эти команды приоритетнее параметра профиля startingDirectory . Similar to PowerShell profiles, your commands there take precedence over the startingDirectory profile setting.

Целью startingDirectory является запуск нового экземпляра Терминала Windows в заданном каталоге. The purpose of startingDirectory is to launch a new Windows Terminal instance in the given directory. Если терминал выполняет любой код, который изменяет каталог, необходимо внимательно изучить этот код. If the terminal runs any code that changes its directory, that may be a good place to take a look.

CTRL+= не увеличивает размер шрифта Ctrl+= does not increase the font size

Если вы используете раскладку клавиатуры на немецком языке, то можете столкнуться с этой проблемой. If you are using a German keyboard layout, you may run into this problem. CTRL+= десериализуется как CTRL+SHIFT+0 , если для главной раскладки клавиатуры задано значение «Немецкий». ctrl+= gets deserialized as ctrl+shift+0 if your main keyboard layout is set to German. Это правильное сопоставление для немецкой раскладки клавиатуры. This is the correct mapping for German keyboards.

Что более важно, приложение никогда не реагирует на нажатие клавиши CTRL+SHIFT+0 . More importantly, the app never receives the ctrl+shift+0 keystroke. Это связано с тем, что сочетание клавиш CTRL+SHIFT+0 зарезервировано в Windows, если активированы несколько раскладок клавиатуры. This is because ctrl+shift+0 is reserved by Windows if you have multiple keyboard layouts active.

Читайте также:  Aptitude linux что это

Если вы хотите отключить эту функцию для правильного функционирования Ctrl+= , следуйте инструкциям в разделе «Изменение сочетаний клавиш для переключения раскладки клавиатуры в Windows 10» в этой записи блога. If you would like to disable this feature in order for Ctrl+= to work properly, follow the instructions for «Change Hotkeys to Switch Keyboard Layout in Windows 10» in this blog post.

Задайте для параметра «Смена раскладки клавиатуры» значение «Не назначено» (или отключите CTRL+SHIFT ), щелкните ОК, а затем — Применить. Change the ‘Switch Keyboard Layout’ option to ‘Not Assigned’ (or off of ctrl+shift ), then select OK and then Apply. Комбинация CTRL+SHIFT+0 должна теперь функционировать в качестве настраиваемого сочетания клавиш и передаваться в терминал. ctrl+shift+0 should now work as a key binding and is passed through to the terminal.

С другой стороны, если вы используете эту возможность сочетания клавиш для нескольких языков ввода, вы можете настроить пользовательское сочетание клавиш в файле SETTINGS.JSON. On the other hand, if you do use this hotkey feature for multiple input languages, you can configure your own custom key binding in your settings.json file.

Текст размыт The text is blurry

Некоторые драйверы экрана и аппаратные конфигурации не могут обрабатывать прокрутку и/или «грязные» области без размытия данных предыдущего кадра. Some display drivers and hardware combinations do not handle scroll and/or dirty regions without blurring the data from the previous frame. Чтобы устранить эту проблему, добавьте набор этих глобальных параметров отрисовки, чтобы снизить нагрузку на оборудование, вызванную отрисовщиком текста терминала. To mitigate this problem, you can add a combination of these global rendering settings to reduce the strain placed on your hardware caused by the terminal text renderer.

Startup settings in Windows Terminal

The properties listed below affect the entire terminal window, regardless of the profile settings. These should be placed at the root of your settings.json file.

Default profile

Set the default profile that opens by typing ctrl+shift+t , typing the key binding assigned to newTab , running wt new-tab without specifying a profile, or clicking the ‘+’ icon.

Property name: defaultProfile

Necessity: Required

Accepts: GUID or profile name as a string

Default value: PowerShell’s GUID

Launch on machine startup

When set to true , this enables the launch of Windows Terminal at startup. Setting this to false will disable the startup task entry.

Note: if the Windows Terminal startup task entry is disabled either by org policy or by user action this setting will have no effect.

Property name: startOnUserLogin

Necessity: Optional

Accepts: true , false

Default value: false

Launch mode

This defines whether the terminal will launch as maximized, full screen, or in a window. Setting this to focus is equivalent to launching the terminal in the default mode, but with focus mode enabled. Similarly, setting this to maximizedFocus will result in launching the terminal in a maximized window with focus mode enabled.

Property name: launchMode

Necessity: Optional

Accepts: «default» , «maximized» , «fullscreen» , «focus» , «maximizedFocus»

Default value: «default»

New instance behavior

This setting controls how new terminal instances attach to existing windows. This property is only used if the —window,-w window command line argument is not provided. This setting accepts the following possible values:

  • useNew : Create a new window, always. This is how the terminal always behaved prior to version 1.7.
  • useExisting : Create new tabs in the most recently used window on this desktop. If there’s not an existing window on this virtual desktop, then create a new terminal window.
  • useAnyExisting : Create new tabs in the most recently used window, regardless of which virtual desktop the window is on.
Читайте также:  Как распаковка windows usb

Property name: windowingBehavior

Necessity: Optional

Accepts: «useNew» , «useExisting» , «useAnyExisting»

Default value: «useNew»

Launch size

Columns on first launch

This is the number of character columns displayed in the window upon first load. If launchMode is set to «maximized» or «maximizedFocus» , this property is ignored.

Property name: initialCols

Necessity: Optional

Accepts: Integer

Default value: 120

Rows on first launch

This is the number of rows displayed in the window upon first load. If launchMode is set to «maximized» or «maximizedFocus» , this property is ignored.

Property name: initialRows

Necessity: Optional

Accepts: Integer

Default value: 30

Launch position

This sets the pixel position of the top left corner of the window upon first load. On a system with multiple displays, these coordinates are relative to the top left of the primary display. If an X or Y coordinate is not provided, the terminal will use the system default for that value. If launchMode is set to «maximized» or «maximizedFocus» , the window will be maximized on the monitor specified by those coordinates.

Property name: initialPosition

Necessity: Optional

Accepts: Coordinates as a string in the following formats: «,» , «#,#» , «#,» , «,#»

Default value: «,»

Center on launch

When set to true , the terminal window will auto-center itself on the display it opens on. The terminal will use the «initialPosition» to determine which display to open on.

This interacts with the other launch settings in the following ways:

  • «initialPos»: x,y , «centerOnLaunch»: true , «launchMode»: «default» : center on the monitor that x,y is on.
  • «initialPos»: x,y , «centerOnLaunch»: true , «launchMode»: «maximized» : maximized on the monitor that x,y is on ( centerOnLaunch adds nothing).
  • «initialPos»: , «centerOnLaunch»: true , «launchMode»: «default» : center on the default monitor.
  • «initialPos»: , «centerOnLaunch»: true , «launchMode»: «focus» : center and enter focus mode on the default monitor.
  • «initialPos»: , «centerOnLaunch»: true , «launchMode»: «maximized» : maximized on the default monitor ( centerOnLaunch adds nothing).

Property name: centerOnLaunch

Necessity: Optional

Accepts: true , false

Default value: false

Disable dynamic profiles

This sets which dynamic profile generators are disabled, preventing them from adding their profiles to the list of profiles on startup. For information on dynamic profiles, visit the Dynamic profiles page.

Property name: disabledProfileSources

Necessity: Optional

Accepts: «Windows.Terminal.Wsl» , «Windows.Terminal.Azure» , and/or «Windows.Terminal.PowershellCore» inside an array

Default value: []

Startup actions

This sets the list of actions to execute on startup, allowing the terminal to launch with a custom set of tabs and panes by default. These actions will be applied only if no command line arguments were supplied. The list of actions is represented by a string with the same format as commands in the command line arguments. For more information about the commands format, visit the Command line arguments page.

Property name: startupActions

Necessity: Optional

Accepts: String representing a list of commands to run

Оцените статью