10

I'm seeing the following behavior in Firebug:

When the debugger is paused on a breakpoint, if I go to the console and attempt to execute a statement, the Enter key keeps just adding lines instead of executing.

I've tried hitting Shift+Enter and Ctrl+Enter also, to no avail.

Gram
  • 376
  • 1
  • 7
  • 19
mtyson
  • 8,196
  • 16
  • 66
  • 106
  • 1
    Are you using the command line or the command editor (toggle-able with the little arrow button above right). In the command editor you must click the "run" button above (then all commands will be executed unless 1 or more are highlighted) – DaveStSomeWhere Jan 18 '15 at 06:22
  • 1
    @DaveCoast: The command editor sounds promising, but I don't see the arrow button to start it. – mtyson Jan 18 '15 at 17:43
  • 1
    The button to switch between the [Command Line](https://getfirebug.com/wiki/index.php/Command_Line) and the [Command Editor](https://getfirebug.com/wiki/index.php/Command_Editor) has an arrow as symbol and is located at the very right side of the panel toolbar. Which version of Firefox and Firebug are you using? – Sebastian Zartner Jan 18 '15 at 22:02

2 Answers2

8

Environment

I sometimes get this issue on firebug (console), FireFox (dev console), and FireFox developer edition (dev console).

Issue

Using the "web console" I would type something like alert("test") and hit the enter key but it would not run.

Instead of running it would enter a new line as if I hit "Shift Enter". Oddly when I hit "Shift Enter" just to see what happens, there is no more new line but the code does not run.

Attempt to find a solution

I restarted my computer, and it went away only to return again later. I don't have a solution but more of a work around (that works some of the time). The biggest issue is I don't know what causes this to happen. After may hours I can only guess what I think the issue is.

I suspect that why this happens is the developer console gets disconnected with the web page that it is trying to debugged.

If the Dev tools are disconnected, then it can not run the code (my alert) because it does not know what page/tab to run it on.

Work Around

Fully closing all Firefox windows/tabs (and its dev/firebug windows/tabs). This may-or-may-not re-associate the console with the web page allowing the code to run again.

Disclaimer

It works for me most of the time, I would be vary happy if someone (who knows more about this) could explain why this happens and a better solution. But until then for anyone else with this issue like me I hope this helps.

Gram
  • 376
  • 1
  • 7
  • 19
  • 2
    I experience this issue as well and closing and restarting firefox will solve it, but it comes back later. Thanks! – Di Zou Jun 09 '15 at 19:36
1

I have experienced the same issue, where I would enter (a long) javascript statement in the console and pressing enter would just add new lines instead of running the statements.

In my case this was caused by brackets and parentheses that were not balanced. Once they were balanced, hitting the enter key would execute the statements.

Pieter Meiresone
  • 1,910
  • 1
  • 22
  • 22