https://stackoverflow.com/questions/58602046/setting-default-position-of-windows-terminal-preview
原问题描述:
On opening Windows Terminal (Preview), part of the window is below the taskbar. When I move the application window to a desired position on screen and re-open the application, it is not at the previous position, which I had set by dragging the window.
In the profile.json settings file, there is no option to set the default window location.
How do keep the window position from previous session, as I don’t want to drag the window every time I open the application?
翻译:
刚打开Windows Terminal的窗口时,窗口偏置右下,一部分将会被任务栏遮住(,关闭按钮也被挡住了,令人很不舒服)。可以将应用程序窗口移动到屏幕上可行的位置,但这次拖动的作用仅限于当次使用。重新打开应用程序时,它并不在我通过拖动窗口设置的前一个位置。
在profiles.json
设置文件中,并没有设置默认窗口位置的选项。从VSCode的补全也能发现这个问题。
这是核心问题所在了
如果不想每次打开应用程序时都拖拽窗口,如何保持窗口处于前一次拖动设置的那个可行位置?
回答:
回复上一次拖动的位置是不可能的,但是可以通过设定默认位置的方式使得每一次重新打开的时候都是一个比较好的位置。
可以使用如下的三个选项设定终端窗口大小以及位置。
"initialCols": 120,
"initialRows": 60,
"initialPosition": "2400,500", // x,y
也可以直接使用launchMode设置,懒人全屏防止遮挡。
"launchMode": "maximized",
特别注意:这几个参数都是在全局中!!!!!不是在profiles中!!!!
可以看到在这种情况下是有补全的噢