我正在使用默认主题。终端的颜色无法读取,毫无意义且不一致。我尝试过切换主题,但是在所有主题中它们都很糟糕。
这是默认情况下的样子。您能在灰色背景下读取我的黄色输入吗?为什么到处都没有黑色背景?

我意识到有些设置可以手动设置前景色/背景色。但是我在想,由于终端的操作方式如此棘手,所以对我来说有些问题。
例如,这是我第一次启动终端时看到的内容,键入一堆东西,按退格键删除其中一半,调整终端窗格的大小,然后再删除更多内容。请注意,一些已删除的空格是如何变成黄色的,而有些则是灰色。另请注意,将显示CWD的区域是全黑的。

这是我settings.json文件的内容:
{
"window.zoomLevel": 0,
"git.enableSmartCommit": true,
"workbench.startupEditor": "newUntitledFile"
}
Run Code Online (Sandbox Code Playgroud)
什么需要修复,如何修复?
编辑:
为了满足您的好奇心,我将此添加到了settings.json文件中:
"workbench.colorCustomizations": {
"terminal.foreground": "#ffffff",
"terminal.background": "#000000"
}
Run Code Online (Sandbox Code Playgroud)
terminal powershell colors visual-studio-code vscode-settings
使用 CSS Paint API 的惯用方式似乎是:
xyz.js文件
paint(ctx, geom, properties)函数的类填充registerPaint,将类作为参数传递CSS.paintWorklet.addModule('xyz.js')从您的电话index.htmlbackground-image: paint(myPaintWorklet);有关更多详细信息,请访问:https : //developers.google.com/web/updates/2018/01/paintapi
但是必须加载单独的 .js 文件会影响性能。
有没有办法内联 PaintWorklet 以便不需要单独的 .js 文件?
我正在尝试异步调用Future从函数返回的 a 。是否可以?
use core::future::Future;
fn choose_your_adventure<'a>(i: usize) -> Box<&'a dyn Future<Output = ()>> {
match i {
0 => Box::new(&async {}),
_ => Box::new(&async {})
}
}
async fn does_not_work() -> () {
let choice = choose_your_adventure(0);
choice.await; // error[E0277]: `&dyn Future<Output = ()>` is not a future
}
Run Code Online (Sandbox Code Playgroud) 我正在编写在 GitHub Pages 上设置 Jekyll的指南。我的 GitHub 存储库发布到~.github.io/hello-pages,所以我很自然地插入{{ site.baseurl }}锚标记等。这很好用。
什么是不工作的永久链接:我必须手动拼出来permalink: /hello-pages/blog/:year/:month/:day/:title.html的_config.yml任何固定链接工作的; 否则他们链接到例如~.github.io/blog/x/y/z而不是~.github.io/hello-pages/blog/x/y/z像我期望的那样。
手动指定baseurl: /hello-pages无效(我想 GitHub 的 Jekyll 配置已经这样做了)。
在任何地方手动输入“/hello-pages”似乎是一种我想避免的严格设计。一个较旧的 SO 答案说永久链接应该“正常工作”。是什么赋予了?
编辑
我正在构建这样的损坏的 URL:
<a href="{{ post.url }}">
我一直在尝试将webauthn添加到Angular应用中。该MDN页面概述了必要的步骤:https : //developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API
重要的是使用API需要访问navigator.credentials。但是,当我尝试引用它时,Angular不会编译。例如,以下代码行:
await navigator.credentials.create({...});
Run Code Online (Sandbox Code Playgroud)
...产生此错误:
error TS2339: Property 'credentials' does not exist on type 'Navigator'.
Run Code Online (Sandbox Code Playgroud)
现在我知道我可以做这样的事情:
declare global {
interface Navigator {
credentials: {
create(): void,
get(): void
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是必须为整个CredentialsContainerAPI 编写所有TypeScript确实很麻烦。此外,有人已经完成了所有工作DefinitelyTyped,对吗?
所以我用添加@types/webappsec-credential-management到了我的项目中npm install --save-dev @types/webappsec-credential-management。
现在,Visual Studio Code知道该怎么做了。我有自动完成功能和所有功能。
但是Angular仍然不会编译。上面给出了相同的错误。
我需要做什么才能使Angular识别navigator.credentials?
fn main() {
let buffer: [u8; 16] = [ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f ];
let (a, b, c, d, e): (u8, u8, u8, [u8; 4], [u8; 9]) = unsafe { core::mem::transmute(buffer) };
println!("{a:#x}");
println!("{b:#x}");
println!("{c:#x}");
println!("{d:#x?}");
println!("{e:#x?}");
}
Run Code Online (Sandbox Code Playgroud)
输出:
0x4
0x5
0x6
[
0x0,
0x1,
0x2,
0x3,
]
[
0x7,
0x8,
0x9,
0xa,
0xb,
0xc,
0xd,
0xe,
0xf,
]
Run Code Online (Sandbox Code Playgroud)
为什么a、b、 和c不分别获取值 …
rust ×2
angular ×1
async-await ×1
colors ×1
css ×1
css-houdini ×1
github-pages ×1
jekyll ×1
permalinks ×1
powershell ×1
terminal ×1
webauthn ×1