Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctrl v, ctrl shift v - known not to work #13

Open
MattBixley opened this issue Oct 7, 2024 · 4 comments
Open

ctrl v, ctrl shift v - known not to work #13

MattBixley opened this issue Oct 7, 2024 · 4 comments

Comments

@MattBixley
Copy link

paste in the terminal doesn't work - longtime know issue varous web threads

rstudio/rstudio#1687

@MattBixley
Copy link
Author

Dini may have found a solution

Right...So, there is what worked but this changes the terminal prompt PS1='\e[?2004l\h:\W \u$
`\e[?2004l: This is an ANSI escape sequence that disables bracketed paste mode in the terminal

@MattBixley
Copy link
Author

`# Disable bracketed paste mode
printf "\e[?2004l"

Set green color

GREEN="[\033[0;32m]"
RESET="[\033[0m]"

Function to get relative path from home

get_relative_path() {
local path=$(pwd)
local home=$HOME
echo "${path/#$home/~}"
}

Set PS1 with green color, user@hostname format, and relative path

PS1="${GREEN}\u@\h:$(get_relative_path)${RESET}$ "`

@MattBixley
Copy link
Author

Above will keep the prompt format exactly as it is while disabling the bracketed paste thing
10:31
So for training environment, we can trigger his on script.sh which means it will set it up during startup. For others, they can either execute it per session OR bashrc

@MattBixley
Copy link
Author

in brief, fix is just the line 2. Rest is to keep the prompt in training environment terminal as it is

Disable bracketed paste mode

printf "\e[?2004l"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant