-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
"clear" broken on Windows when using with Git BASH #1559
Comments
I was having all kinds of various problems writing to the screen until I set the environment var TERM=msys. I think it was set to cygwin which worked in 1.1.0. Maybe that will help? |
@jmcmellen Solved it for me, thanks. |
|
+1 |
Was having the exact same issue. Now I'm using the command |
Sorry guys I'm pretty new in this, but where i can change that |
@TheMartes |
@jmcmellen Thanks that worked! If someone is looking to actually clear the screen (not just scroll down) in bash, here's how: alias cls="echo -e '\\0033\\0143'" Then, just type |
I tried with |
@math2001 Thank you! It's useful! |
@MSaIim what platform are you on? are you using @vuongggggg: you're welcome! 🙂 |
@math2001 I am on Windows 10 64bit and yes I am use bash from Git on Windows. |
Did you restarted hyper? did you added |
Thank you very much! I didn't put it inside the |
Glad I could help! Could a collaborator or the owner add a tag like |
@math2001 Why does your workaround work? Why the extra escaped characters?
|
Setting the |
YES!! This trick seems to make ctrl+c work properly too! Thanks a lot @cnswico!! 🎉 👍 😄 |
@geekosupremo the escape characters are the ANSI escape sequence for resetting the terminal "ESC c" You could also write it as: alis cls="echo -e '\\0033c'" In general, I would expect clear to do precisely this, but I suppose that it is possible that, if the TERM variable were set incorrectly, it might do something else (for instance if it thought you were using a line or dumb terminal). |
Also, I would set TERM to |
Or, for that matter |
Also, for those of you having problems, it would be helpful to know what you have $TERM set to. The output of: echo $TERM would help anyone debugging this issue. Also, you might want to check your terminal init files to see if they are setting it incorrectly. |
I'm losing my text from time to time and I have to do a reset my $TERM = cygwin |
Can you explain where to put this info? I am not clear. |
You place it in your Alternatively, you may find the file in your User directory ( In the |
@christianwico still doesn't seem to work. I don't have that bash.exe in that specific path, but it's here: |
I came here to find this because tools like top and nano were not clearing the screen when rendering, so previous console output was bleeding through anywhere there was space. Thank you so much for the TERM:"cygwin" solution. Mine was "xterm-256color" by default. (Also using Hyper with Git for Windows bash and Cygwin.) |
For Windows 10 users, in Hyper:
Add/update the following lines: // the shell to run when spawning a new session (i.e. /usr/local/bin/fish)
// if left empty, your system's login shell will be used by default
// make sure to use a full path if the binary name doesn't work
// (e.g `C:\\Windows\\System32\\bash.exe` instead of just `bash.exe`)
// if you're using powershell, make sure to remove the `--login` below
shell: 'C:\\Program Files\\Git\\git-cmd.exe',
// for setting shell arguments (i.e. for using interactive shellArgs: ['-i'])
// by default ['--login'] will be used
shellArgs: ['--command=usr/bin/bash.exe', '-l', '-i'],
// for environment variables
env: {
TERM: 'cygwin'
}, |
I'm also still getting issues with the screen buffer failing to clear, tried setting TERM to a variety of different things, nothing seems to work :( Using the latest version of Hyper, are there any other methods to getting this work? Just trying to get Hyper and zsh to work on Windows.. |
Ha! Thanks! env: {
TERM: 'msys'
} |
Neither 'mysys' nor 'cygwin' are helping with the clear issue (Windows 10 Fall Creators Update) |
Any update since Fall Creators Update? |
The 'cygwin' solution is currently working for me on Windows 10 version 1709 (Fall Creators Update). env: {
TERM: 'cygwin'
} |
@hermbit the 'cygwin' solution works, but then we lose 256 color support (the colors set up on my PS1 are gone when using |
👍 on losing 256 colors with TERM: cygwin or msys. |
I was having the same issue using clear with Hyper hooked up to Cmdr on Windows 10. |
Work around for win10 Install hyper-startup extension Add alias commands
|
Microsoft Windows [version 10.0.17134.590]Set env to cygwin works perfectly for me ;) thx @michaelauderer
|
Has there been a regression here? TERM=cygwin fixes the problem for Hyper EDIT: Whoops, it looks like it's not the same issue. In the issue I am currently experiencing, TERM=cygwin doesn't fix it, and if you type 'clear' and then click anywhere inside the window, the clear will work. In issue #1559, clicking won't do anything, and the issue is fixed by TERM=cygwin. |
Hyper 3 now doesn't clear the screen, so I have to downgrade to 2. It only clears when clicking on it, but it is very unconvenient. |
@talentlessguy make sure your Hyper config has been updated. Hyper 3 uses a different config location and ships with a default config. #3605 |
Any update on this? My hyper config is updated at |
Absolutely - I set TERM to Using an alias seemed to do the trick for me... |
@edwardbeckett Yep, |
Issue
I've set up Hyper on Windows to use the bash that comes bundled with Git for windows, however when I run the clear command, the contents of the window is not cleared, though the prompt does move back to the top of the screen, over the top of the pervious content.
The text was updated successfully, but these errors were encountered: