github / github/copilot-cli

~/.bash_history is truncated after copilot executes a Bash command

未关闭
#2,317 2 条评论 9 个 reaction 已指派 0 人 在 GitHub 查看
area:tools
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the bug

See: https://github.com/github/copilot-cli/issues/501 for additional context. I believe that #501 should be re-opened, as the fixes mentioned in it are incomplete.

TL;DR: When Copilot executes a Bash command, it truncates the user's `~/.bash_history`, ignoring the user's `HISTFILESIZE`. This is a consequence of the manner in which Bash is invoked (an interactive shell spawned with `bash --norc --noprofile`)

### Affected version

v1.0.11

### Steps to reproduce the behavior

1. Observe `wc -l ~/.bash_history`
2. Instruct copilot to run a Bash command
3. Observe `wc -l ~/.bash_history`

### Expected behavior

Copilot does not modify `~/.bash_history` in any way, especially not truncation.

### Additional context

This issue can be worked around by adding the following shim to your `~/.bashrc`.

```
copilot() {
HISTFILE=/dev/null command copilot "$@"
}
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。