warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
21.58k stars 379 forks source link

SSH error, bash: history: /home/user/.bash_history: cannot create: Permission denied, after running every command #4377

Open Mharden1 opened 9 months ago

Mharden1 commented 9 months ago

Discord username (optional)

No response

Describe the bug

when i ssh into a server, after every command i run, whether or not the command is successful, bash: history: /home/user/.bash_history: cannot create: Permission denied is printed to the command line.

To reproduce

  1. SSH into a server
  2. run any command, for instance ls
  3. below the response should be another block with an error message: bash: history: /home/bandit16/.bash_history: cannot create: Permission denied

Expected behavior

I would expect to only receive the response of the command executed, and not receive a permission denied for a command i did not run.

Screenshots

No response

Operating system

MacOS

Operating system and version

14.3.0

Shell Version

zsh 5.9

Current Warp version

v0.2024.02.20.08.01.stable_02

Regression

Yes, this bug started recently or with an X Warp version

Recent working Warp date

No response

Additional context

I have only recently starting using SSH in warp so am not sure which version it started.

Does this block you from using Warp daily?

No

Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)

Yes, this I confirmed this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e

None

LFd3v commented 9 months ago

Hi, there. It seems that Warp uses its own built-in features for auto-completion and history search, thus access to .bash_history is required. Could you please check if the file exists in the remote and local machines, and that your user has permission to read and write it? Thank you.

Mharden1 commented 9 months ago

Hi, locally i do not have a .bash_history file, but there is a .zsh_history file. As for the server i am connecting to there is neither. Not sure if I would have access to it due to it not existing. However I do not have permission to write in this directory. So, I cannot create the file myself.

rjurney commented 4 months ago

I have this error and it is annoying when I Warpify Shell in an Ubuntu derived Docker container: bash: history: //.bash_history: cannot create: Permission denied. Please fix :(

rafaelfe commented 1 month ago

This happens because your user doesn't have permission to create the file .bash_history on the user home directory. The .bash_history file simply stores the list of commands you run in the shell.

To fix this message:

  1. sudo touch /home/.bash_history to create the file
  2. sudo chown {your_user} /home/.bash_history to change ownership of the file to your user