alibaba / alibaba/arthas

macOS 终端ctrl+z 不能暂停job执行

Open
#1,069 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
37.5k
Forks
7.6k
Avg merge
1d 22h
Merged PRs (30d)
4

Description

- [x] 我已经在 [issues](https://github.com/alibaba/arthas/issues) 里搜索,没有重复的issue。

### 环境信息

* `arthas-boot.jar` 或者 `as.sh` 的版本: 3.1.7
* Arthas 版本: 3.1.7
* 操作系统版本: macOS 10.15.2
* 目标进程的JVM版本: Oracle JDK 1.8.0_151
* 执行`arthas-boot`的版本: 3.1.7

### 重现问题的步骤

1. 在macOS终端中执行命令:java -jar arthas-boot.jar 启动注入Arthas到目标JVM
2. 在arthas shell中执行:watch demo.MathGame primeFactors 'params'
3. 按Ctrl + z 组合键

### 期望的结果

What do you expected from the above steps?

在arthas shell中暂停执行watch命令,暂停后执行fg可以将任务切换到前台执行,按Ctrl+C终止arthas命令,但不会退出arthas shell。

### 实际运行的结果

实际运行结果,最好有详细的日志,异常栈。尽量贴文本。
实际上在Arthas shell中按Ctrl+z触发了zsh的任务切换,挂起了arthas shell进程。
继续输入fg命令唤起arthas shell进程,按Ctrl+C组合键,直接退出了arthas shell进程。
```
[arthas@8697]$ watch demo.MathGame primeFactors 'params'
watch demo.MathGame primeFactors 'params'
Press Q or Ctrl+C to abort.
Affect(class-cnt:1 , method-cnt:1) cost in 11 ms.
ts=2020-03-24 19:11:05; [cost=0.132023ms] result=@Object[][
@Integer[41170],
]
ts=2020-03-24 19:11:06; [cost=0.230026ms] result=@Object[][
@Integer[-173846],
]
^Z
zsh: suspended java -jar arthas-boot.jar
xxxx@xxxx arthas-3 %
xxxx@xxxx arthas-3 % fg
[1] + continued java -jar arthas-boot.jar
ts=2020-03-24 19:11:07; [cost=0.073101ms] result=@Object[][
@Integer[-48626],
]
ts=2020-03-24 19:11:12; [cost=0.049237ms] result=@Object[][
@Integer[-82092],
]
^C%
xxxx@xxxx arthas-3 %
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior on macOS 10.15.2 using zsh and arthas-boot.jar, then trace how the Arthas shell handles Ctrl+Z, fg, and Ctrl+C. Done means Ctrl+Z pauses the watch command, fg resumes it, and Ctrl+C stops the command without exiting the Arthas shell.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, zsh
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.