aws / aws/amazon-q-developer-cli

Disabling markdown rendering causes code indentation issue

Open
#3,031 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2k
Forks
439
PR merge metrics
No merged PRs in 30d

Description

### Checks

- [x] I have searched [github.com/aws/amazon-q-developer-cli/issues](https://github.com/aws/amazon-q-developer-cli/issues?q=) and there are no duplicates of my issue
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again

### Operating system

macOS 26.0.0 (25A354)

### Expected behaviour

Code indentation must be correct regardless of markdown rendering. Python code should use 4 spaces per
indentation level.

### Actual behaviour

When markdown rendering is disabled, Python code blocks lose one space per indentation level. Single indentation shows as 3 spaces instead of 4, and double indentation shows as 7 spaces instead of 8. This suggests the renderer is consuming one space from each tab conversion.

### Steps to reproduce

```
➜ ~ q settings chat.disableMarkdownRendering false
➜ ~ q chat
> show code for fibonnaci series in python simple. just show the code
> python
def fibonacci(n):
if n <= 1:
return n
return fibonacci(n-1) + fibonacci(n-2)

# Print first 10 numbers
for i in range(10):
print(fibonacci(i))
> /exit

➜ ~ q settings chat.disableMarkdownRendering true
➜ ~ q chat
> show code for fibonnaci series in python simple. just show the code
> ```python
def fibonacci(n):
if n <= 1:
return n
return fibonacci(n-1) + fibonacci(n-2)

# Print first 10 numbers
for i in range(10):
print(fibonacci(i))
\```
> /exit
```

### Environment

```yaml

[q-details]
version = "1.16.2"
hash = "c4c80bb44cb22b6e19129ed7475f2793ff20135d"
date = "2025-09-19T01:27:56.356289Z (10d ago)"

[system-info]
os = "macOS 26.0.0 (25A354)"
chip = "Apple M3 Pro"
total-cores = 12
memory = "36.00 GB"

[environment]
cwd = "/Users/USER/stuff/q-api-wrapper"
cli-path = "/Users/USER/stuff/q-api-wrapper"
install-method = "toolbox"

[env-vars]
PATH = "/Users/USER/.local/share/mise/installs/node/22.16.0/bin:/Users/USER/.local/share/mise/installs/python/3.12.11/bin:/Users/USER/.local/share/mise/installs/python/3.11.13/bin:/Users/USER/.local/share/mise/installs/python/3.10.18/bin:/Users/USER/.local/share/mise/installs/python/3.9.23/bin:/Users/USER/.local/share/mise/installs/python/3.8.20/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/USER/.toolbox/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/USER/.atuin/bin:/Users/USER/.cargo/bin:/Applications/Ghostty.app/Contents/MacOS:/Users/USER/.local/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/USER/bin:/Users/USER/workplace/PmScripts:/Users/USER/bin:/Users/USER/workplace/PmScripts"
QTERM_SESSION_ID = "685a86d0ac78480a92c3d0e64444b27a"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "1.16.2"
SHELL = "/bin/zsh"
TERM = "tmux-256color"
__CFBundleIdentifier = "com.mitchellh.ghostty"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.