Ever since the latest update, it seems I can't clear the terminal with command+K. This issue only happens when I have done npm start
to start webpack for one of my apps. Currently, whenever I press command+K, it makes ^L
appear at the bottom of the terminal.
Here is a screenshot of the issue: (You can see the ^L
come everytime I try to clear at the bottom):
EDIT: Just to provide some more info, if I exit out of the process with control+C, and then run the clear with command+K it works fine.
Same issue when running tail -f
. Also, since the update CMD+K does not completely clear the buffer. I know this behavior is expected, but sometimes it is useful to actually clear the terminal completely (for example long running tails of logs, or running a cat
of a huge file). Maybe this behavior should be a configuration.
looking at the PR, it seems that they did account for this before and are simply disabling it by default now.
It's happening on windows 8.1 as well
Same issue when running any command that would require a redraw on the last available line, it just goes up and up and up instead of clearing the previous line.
Experiencing this as well, in addition to the behavior changing: previously, cmd-k would actually clear the contents (this is I believe the intended behavior), but it now just clears the screen while preserving scrollback. Is that an intended feature change or a regression? How do I actually clear my scrollback?
@jesseditson You can test my PR and it will work!
Windows 7 also affected.
But compared to macOS it will not start to work after any manipulation. 馃槙
PS: clear
command works well. As Edit > Clear
menu item.
Linux (Mint 18.1) also affected.
Before, CTRL+K cleared the window + buffer/history.
Now, CTRL+K is same as CTRL+L.
When I use ctrl-K (clear), I do not get any clearing.
The cursor moves to the top (as if the text cleared) but I have ghost text.
Right now even Edit > Clear
menu item stopped working on Windows 7. :sob:
I'm almost at the point of moving to another app. :tired_face:
Please, fix this annoying bug asap. :pray:
Thanks. :slightly_smiling_face:
@hiseni you know, that pull-requests are welcomed, right?
In iTerm you can press commend+shift+K to completely clear the scrollback buffer, maybe Hyper can add a keymap like this...
I'm pretty sure Hyper already cleared the scrollback buffer before, that issue seemed to start the same time this issue of not being able to clear did.
You can use CTRL-SHIFT-K to clear. The weird bug still exists but if you use that, then you can clear the screen. However, its weird, because if you clear the screen with ctrl shift k, and then run the clear command, that your past commands will pop up again in the terminal. You can get rid of them by running other random commands and 'ctrl-shift-k'ing a bunch of times.
Nice, using Ctrl+Shift+K works for now as a workaround to clear the screen. Thanks for the tip on that.
This is the issue I brought up in the stream - you cannot rely on sending escape sequences for this sort of thing as different shells have different default escape sequence behavior, can be customized or may not do anything (probably the case on Windows). This is the same reason XON/XOFF will not work for the general case.
I recommend going back to the previous behavior (I'm assuming it cleared fine, it just didn't work for multi-line prompts).
On Windows it now does this https://gfycat.com/ShockingCelebratedGreatwhiteshark
Bugs out after ctrl k and can be fixed by hitting enter once
try reset
.
Mapping the reset command as an alias for clear works well
So that would be a change to the Windows only default config, correct? Mapping it to reset?
I just created an alias in the .bash_profile config on Windows 7. I can't say about other platforms.
This looks to be fixed for me now. I'm on 1.4.3 (stable), macOS 10.12.6.
The screen clears for me, but there's al ^L
at the top of the terminal window, and if I hit enter it attempts to execute some whitespace/newline characters as a command, and bash spits out an error:
^L
bash:
: command not found
I am seeing the same result as @TooTallNate. Might be an issue with users with the name Nate :)
Hyper v2 is out now, and it looks like this is no longer an issue :)
Think it's safe for me to close this, anyone can let me know if they still seem to have the issue after upgrading to v2 and I'll reopen.
Looks good to me!
Single-line prompts clear fine for me (yay!) but it seems only the last line is displayed with multi-line prompts. Commands like clear
work fine.
@timgthomas this is as designed currently. It's a very tricky problem to solve this generically in a way that would work in all shells/platforms.
Maybe just make it user-configurable @Tyriar?
@albinekb previously you sent ^L
when ctrl+k was pressed. You're welcome to do this, I would recommend not doing it under all environments though you did in v1 as you'll run into why this issue was created in the first place: https://github.com/zeit/hyper/issues/1808#issuecomment-302764540
This is not something that makes sense in the xterm.js layer as xterm.js knows nothing about what shell is running.
@albinekb this seems to work great 馃憤 https://github.com/Microsoft/vscode/blob/a443a44f40a6ab6595101f418e5fac91b5c93d10/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts#L569-L577
Nice! Let's do the same in Hyper. I have a lot going on at work so won't have time for a couple weeks, PR welcome 馃檹
ctrl+shift+k work for me.
I've changed bind to ctrl+L in hyper config by this lines
keymaps: {
"editor:clearBuffer": "ctrl+l",
},
Most helpful comment
You can use CTRL-SHIFT-K to clear. The weird bug still exists but if you use that, then you can clear the screen. However, its weird, because if you clear the screen with ctrl shift k, and then run the clear command, that your past commands will pop up again in the terminal. You can get rid of them by running other random commands and 'ctrl-shift-k'ing a bunch of times.